From 78abc0ea31090b236eae36a36d806cd521d551ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Mon, 3 Jul 2023 08:03:15 +0000 Subject: [PATCH 01/10] Set resource limits for operator deployment (#700) For https://github.com/stackabletech/issues/issues/368 we need to set resource limits on all resources deployed by our helm charts. --- deploy/helm/zookeeper-operator/values.yaml | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/deploy/helm/zookeeper-operator/values.yaml b/deploy/helm/zookeeper-operator/values.yaml index 8dc4b0ac..80a4479b 100644 --- a/deploy/helm/zookeeper-operator/values.yaml +++ b/deploy/helm/zookeeper-operator/values.yaml @@ -30,17 +30,13 @@ securityContext: {} # runAsNonRoot: true # runAsUser: 1000 -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi +resources: + limits: + cpu: 100m + memory: 128Mi + requests: + cpu: 100m + memory: 128Mi nodeSelector: {} From de061669d59ff33f80d1ee2c8be2ab7d59970282 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Mon, 3 Jul 2023 10:35:57 +0000 Subject: [PATCH 02/10] feat: Support podOverrides (#698) # Description Part of https://github.com/stackabletech/issues/issues/346 --- CHANGELOG.md | 4 +- rust/crd/src/lib.rs | 97 +++++++++++++++++------ rust/operator-binary/src/zk_controller.rs | 38 +++++---- 3 files changed, 96 insertions(+), 43 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad00e4e2..f6c1b838 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,8 @@ All notable changes to this project will be documented in this file. - Expose `ZOOKEEPER_CLIENT_PORT` in discovery CM ([#675], [#676]). - Support for ZooKeeper `3.8.1` ([#689]). - Set explicit resources on all containers ([#693], [#699]). -- Added kuttl test suites ([#696]) +- Added kuttl test suites ([#696]). +- Support podOverrides ([#698]). ### Fixed @@ -33,6 +34,7 @@ All notable changes to this project will be documented in this file. [#689]: https://github.com/stackabletech/zookeeper-operator/pull/689 [#693]: https://github.com/stackabletech/zookeeper-operator/pull/693 [#696]: https://github.com/stackabletech/zookeeper-operator/pull/696 +[#698]: https://github.com/stackabletech/zookeeper-operator/pull/698 [#699]: https://github.com/stackabletech/zookeeper-operator/pull/699 ## [23.4.0] - 2023-04-17 diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index b1970f2c..9fbe8f8d 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -33,8 +33,8 @@ use stackable_operator::{ schemars::{self, JsonSchema}, status::condition::{ClusterCondition, HasStatusCondition}, }; -use std::collections::BTreeMap; -use strum::{Display, EnumIter, EnumString}; +use std::{collections::BTreeMap, str::FromStr}; +use strum::{Display, EnumIter, EnumString, IntoEnumIterator}; pub const APP_NAME: &str = "zookeeper"; pub const OPERATOR_NAME: &str = "zookeeper.stackable.tech"; @@ -68,8 +68,16 @@ pub const DOCKER_IMAGE_BASE_NAME: &str = "zookeeper"; pub enum Error { #[snafu(display("object has no namespace associated"))] NoNamespace, - #[snafu(display("unknown ZooKeeper role found {role}. Should be one of {roles:?}"))] - UnknownZookeeperRole { role: String, roles: Vec }, + #[snafu(display("unknown role {role}. Should be one of {roles:?}"))] + UnknownZookeeperRole { + source: strum::ParseError, + role: String, + roles: Vec, + }, + #[snafu(display("the role {role} is not defined"))] + CannotRetrieveZookeeperRole { role: String }, + #[snafu(display("the role group {role_group} is not defined"))] + CannotRetrieveZookeeperRoleGroup { role_group: String }, #[snafu(display("fragment validation failure"))] FragmentValidationFailure { source: ValidationError }, #[snafu(display("invalid java heap config - missing default or value in crd?"))] @@ -366,7 +374,17 @@ impl Configuration for ZookeeperConfigFragment { } #[derive( - Clone, Debug, Deserialize, Display, EnumString, Eq, Hash, JsonSchema, PartialEq, Serialize, + Clone, + Debug, + Deserialize, + Display, + EnumIter, + Eq, + Hash, + JsonSchema, + PartialEq, + Serialize, + EnumString, )] #[strum(serialize_all = "camelCase")] pub enum ZookeeperRole { @@ -374,6 +392,16 @@ pub enum ZookeeperRole { Server, } +impl ZookeeperRole { + pub fn roles() -> Vec { + let mut roles = vec![]; + for role in Self::iter() { + roles.push(role.to_string()) + } + roles + } +} + #[derive(Clone, Default, Debug, Deserialize, Eq, JsonSchema, PartialEq, Serialize)] #[serde(rename_all = "camelCase")] pub struct ZookeeperClusterStatus { @@ -435,6 +463,39 @@ impl ZookeeperCluster { )) } + /// Returns a reference to the role. Raises an error if the role is not defined. + pub fn role( + &self, + role_variant: &ZookeeperRole, + ) -> Result<&Role, Error> { + match role_variant { + ZookeeperRole::Server => self.spec.servers.as_ref(), + } + .with_context(|| CannotRetrieveZookeeperRoleSnafu { + role: role_variant.to_string(), + }) + } + + /// Returns a reference to the role group. Raises an error if the role or role group are not defined. + pub fn rolegroup( + &self, + rolegroup_ref: &RoleGroupRef, + ) -> Result, Error> { + let role_variant = ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| { + UnknownZookeeperRoleSnafu { + role: rolegroup_ref.role.to_owned(), + roles: ZookeeperRole::roles(), + } + })?; + let role = self.role(&role_variant)?; + role.role_groups + .get(&rolegroup_ref.role_group) + .with_context(|| CannotRetrieveZookeeperRoleGroupSnafu { + role_group: rolegroup_ref.role_group.to_owned(), + }) + .cloned() + } + /// Metadata about a server rolegroup pub fn server_rolegroup_ref( &self, @@ -490,27 +551,13 @@ impl ZookeeperCluster { // Initialize the result with all default values as baseline let conf_defaults = ZookeeperConfig::default_server_config(&self.name_any(), role); - let role = match role { - ZookeeperRole::Server => { - self.spec - .servers - .as_ref() - .context(UnknownZookeeperRoleSnafu { - role: role.to_string(), - roles: vec![role.to_string()], - })? - } - }; - // Retrieve role resource config + let role = self.role(role)?; let mut conf_role = role.config.config.to_owned(); // Retrieve rolegroup specific resource config - let mut conf_rolegroup = role - .role_groups - .get(&rolegroup_ref.role_group) - .map(|rg| rg.config.config.clone()) - .unwrap_or_default(); + let role_group = self.rolegroup(rolegroup_ref)?; + let mut conf_role_group = role_group.config.config; if let Some(RoleGroup { selector: Some(selector), @@ -520,7 +567,7 @@ impl ZookeeperCluster { // Migrate old `selector` attribute, see ADR 26 affinities. // TODO Can be removed after support for the old `selector` field is dropped. #[allow(deprecated)] - conf_rolegroup.affinity.add_legacy_selector(selector); + conf_role_group.affinity.add_legacy_selector(selector); } // Merge more specific configs into default config @@ -529,9 +576,9 @@ impl ZookeeperCluster { // 2. Role // 3. Default conf_role.merge(&conf_defaults); - conf_rolegroup.merge(&conf_role); + conf_role_group.merge(&conf_role); - fragment::validate(conf_rolegroup).context(FragmentValidationFailureSnafu) + fragment::validate(conf_role_group).context(FragmentValidationFailureSnafu) } pub fn logging( diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 1b35056c..aea87196 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -29,6 +29,7 @@ use stackable_operator::{ }, }, apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::LabelSelector}, + DeepMerge, }, kube::{api::DynamicObject, runtime::controller, Resource}, labels::{role_group_selector_labels, role_selector_labels}, @@ -88,6 +89,10 @@ pub enum Error { source: strum::ParseError, role: String, }, + #[snafu(display("internal operator failure"))] + InternalOperatorFailure { + source: stackable_zookeeper_crd::Error, + }, #[snafu(display("failed to calculate global service name"))] GlobalServiceNameNotFound, #[snafu(display("failed to calculate service name for role {}", rolegroup))] @@ -179,7 +184,7 @@ pub enum Error { source: stackable_zookeeper_crd::security::Error, }, #[snafu(display("failed to resolve and merge config for role and role group"))] - FailedToresolveConfig { + FailedToResolveConfig { source: stackable_zookeeper_crd::Error, }, } @@ -194,6 +199,7 @@ impl ReconcilerError for Error { Error::CrdValidationFailure { .. } => None, Error::NoServerRole => None, Error::RoleParseFailure { .. } => None, + Error::InternalOperatorFailure { .. } => None, Error::GlobalServiceNameNotFound => None, Error::RoleGroupServiceNameNotFound { .. } => None, Error::ApplyRoleService { .. } => None, @@ -216,7 +222,7 @@ impl ReconcilerError for Error { Error::ResolveVectorAggregatorAddress { .. } => None, Error::InvalidLoggingConfig { .. } => None, Error::FailedToInitializeSecurityContext { .. } => None, - Error::FailedToresolveConfig { .. } => None, + Error::FailedToResolveConfig { .. } => None, } } } @@ -297,11 +303,12 @@ pub async fn reconcile_zk(zk: Arc, ctx: Arc) -> Result, ctx: Arc) -> Result, server_config: &HashMap>, zookeeper_security: &ZookeeperSecurity, resolved_product_image: &ResolvedProductImage, config: &ZookeeperConfig, ) -> Result { - let zk_role = - ZookeeperRole::from_str(&rolegroup_ref.role).with_context(|_| RoleParseFailureSnafu { - role: rolegroup_ref.role.to_string(), - })?; + let role = zk.role(zk_role).context(InternalOperatorFailureSnafu)?; let rolegroup = zk - .spec - .servers - .as_ref() - .context(NoServerRoleSnafu)? - .role_groups - .get(&rolegroup_ref.role_group); + .rolegroup(rolegroup_ref) + .context(InternalOperatorFailureSnafu)?; let logging = zk - .logging(&zk_role, rolegroup_ref) + .logging(zk_role, rolegroup_ref) .context(CrdValidationFailureSnafu)?; let mut env_vars = server_config @@ -614,7 +616,7 @@ fn build_server_rolegroup_statefulset( .collect::>(); let (pvc, resources) = zk - .resources(&zk_role, rolegroup_ref) + .resources(zk_role, rolegroup_ref) .context(CrdValidationFailureSnafu)?; // set heap size if available let heap_limits = zk @@ -807,7 +809,9 @@ fn build_server_rolegroup_statefulset( )); } - let pod_template = pod_builder.build_template(); + let mut pod_template = pod_builder.build_template(); + pod_template.merge_from(role.config.pod_overrides.clone()); + pod_template.merge_from(rolegroup.config.pod_overrides.clone()); Ok(StatefulSet { metadata: ObjectMetaBuilder::new() @@ -828,7 +832,7 @@ fn build_server_rolegroup_statefulset( .build(), spec: Some(StatefulSetSpec { pod_management_policy: Some("Parallel".to_string()), - replicas: rolegroup.and_then(|rg| rg.replicas).map(i32::from), + replicas: rolegroup.replicas.map(i32::from), selector: LabelSelector { match_labels: Some(role_group_selector_labels( zk, From 2dcc0d009a9b1253401ad20fbdc2ed7066c121fe Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Tue, 4 Jul 2023 12:37:42 +0000 Subject: [PATCH 03/10] test: Add test for podOverrides (#702) # Description *Please add a description here. This will become the commit message of the merge request later.* --- CHANGELOG.md | 3 ++- tests/templates/kuttl/smoke/10-assert.yaml.j2 | 4 ++-- .../kuttl/smoke/10-install-zookeeper.yaml.j2 | 11 ++++++++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f6c1b838..297feead 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ All notable changes to this project will be documented in this file. - Support for ZooKeeper `3.8.1` ([#689]). - Set explicit resources on all containers ([#693], [#699]). - Added kuttl test suites ([#696]). -- Support podOverrides ([#698]). +- Support podOverrides ([#698], [#702]). ### Fixed @@ -36,6 +36,7 @@ All notable changes to this project will be documented in this file. [#696]: https://github.com/stackabletech/zookeeper-operator/pull/696 [#698]: https://github.com/stackabletech/zookeeper-operator/pull/698 [#699]: https://github.com/stackabletech/zookeeper-operator/pull/699 +[#702]: https://github.com/stackabletech/zookeeper-operator/pull/702 ## [23.4.0] - 2023-04-17 diff --git a/tests/templates/kuttl/smoke/10-assert.yaml.j2 b/tests/templates/kuttl/smoke/10-assert.yaml.j2 index 7f942cbc..fedde907 100644 --- a/tests/templates/kuttl/smoke/10-assert.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-assert.yaml.j2 @@ -39,10 +39,10 @@ spec: - name: zookeeper resources: limits: - cpu: 500m + cpu: 600m # From podOverrides memory: 512Mi requests: - cpu: 250m + cpu: 300m # From podOverrides memory: 512Mi {% if lookup('env', 'VECTOR_AGGREGATOR') %} - name: vector diff --git a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 index cebedee3..950c68ce 100644 --- a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 @@ -44,7 +44,7 @@ spec: max: '500m' min: '250m' memory: - limit: '0.5Gi' + limit: '512Mi' roleGroups: primary: replicas: 2 @@ -58,6 +58,15 @@ spec: storage: data: capacity: '2Gi' + podOverrides: + spec: + containers: + - name: zookeeper + resources: + requests: + cpu: 300m + limits: + cpu: 600m {% if test_scenario['values']['use-client-auth-tls'] == 'true' %} --- apiVersion: authentication.stackable.tech/v1alpha1 From 1488e7cd80e79ed1d53b62ec6c27abab528a7ea6 Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Wed, 5 Jul 2023 06:33:03 +0000 Subject: [PATCH 04/10] nightly test suite (#701) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Part of https://github.com/stackabletech/ci/issues/62 ``` (stackable) ➜ zookeeper-operator git:(feat/nightly-suite) ✗ beku -s nightly INFO:root:Expanding test case id [smoke_zookeeper-3.8.1-stackable0.0.0-dev_use-server-tls-true_use-client-auth-tls-true] INFO:root:Expanding test case id [delete-rolegroup_zookeeper-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [znode_zookeeper-latest-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [logging_zookeeper-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [cluster-operation_zookeeper-latest-3.8.1-stackable0.0.0-dev] ``` ``` (stackable) ➜ zookeeper-operator git:(feat/nightly-suite) ✗ beku -s smoke-latest INFO:root:Expanding test case id [smoke_zookeeper-3.8.1-stackable0.0.0-dev_use-server-tls-false_use-client-auth-tls-false] ``` ``` (stackable) ➜ zookeeper-operator git:(feat/nightly-suite) ✗ beku -s openshift INFO:root:Expanding test case id [smoke_zookeeper-3.8.1-stackable0.0.0-dev_use-server-tls-true_use-client-auth-tls-true] INFO:root:Expanding test case id [delete-rolegroup_zookeeper-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [znode_zookeeper-latest-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [logging_zookeeper-3.8.1-stackable0.0.0-dev] INFO:root:Expanding test case id [cluster-operation_zookeeper-latest-3.8.1-stackable0.0.0-dev] ``` --- tests/test-definition.yaml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 5f181c0f..3ae430b0 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -36,17 +36,31 @@ tests: dimensions: - zookeeper-latest suites: - - name: latest + - name: nightly patch: - dimensions: - - expr: last - - name: smoke + - name: zookeeper + expr: last + - name: use-server-tls + expr: "true" + - name: use-client-auth-tls + expr: "true" + - name: smoke-latest select: - smoke + patch: + - dimensions: + - expr: last - name: openshift patch: - dimensions: - expr: last - dimensions: + - name: zookeeper + expr: last + - name: use-server-tls + expr: "true" + - name: use-client-auth-tls + expr: "true" - name: openshift expr: "true" From d4a0669eb3e39223374357ea8fd3e6cff24c24b4 Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Wed, 12 Jul 2023 13:04:25 +0000 Subject: [PATCH 05/10] Update templated files to rev e5dc6b2 (#703) Automatically created PR based on commit e5dc6b260bd7131ec3112483755d54755fba62cc in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: Techassi with message [Add Helm chart (re-)generation as pre-commit hook] --- .github/ISSUE_TEMPLATE/config.yml | 9 +++------ .pre-commit-config.yaml | 9 +++++++++ .readme/partials/borrowed/footer.md.j2 | 8 +++----- Makefile | 3 +++ README.md | 8 +++----- docker/Dockerfile | 2 +- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 87368745..9cf5052d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,12 +1,9 @@ --- blank_issues_enabled: true contact_links: - - name: Feature request - about: 🚀 Suggest an idea for this project - url: https://github.com/orgs/stackabletech/discussions/new?category=ideas - name: 🙋🏾 Question about: Use this to ask a question about this project - url: https://github.com/orgs/stackabletech/discussions/new?category=general - - name: Other issue - about: Open an issue that doesn't fit any other category + url: https://github.com/orgs/stackabletech/discussions/new?category=q-a + - name: 🚀 Feature Requests and other things + about: Open an issue with your feature request or any other issue not covered elsewhere url: https://github.com/stackabletech/zookeeper-operator/issues/new diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7153b386..6a450dd6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,3 +33,12 @@ repos: rev: 4.0.1 hooks: - id: flake8 + + - repo: local + hooks: + - id: regenerate-charts + name: regenerate-charts + language: system + entry: make regenerate-charts + stages: [commit, merge-commit, manual] + pass_filenames: false diff --git a/.readme/partials/borrowed/footer.md.j2 b/.readme/partials/borrowed/footer.md.j2 index 8c9aa897..a358a0cc 100644 --- a/.readme/partials/borrowed/footer.md.j2 +++ b/.readme/partials/borrowed/footer.md.j2 @@ -21,11 +21,9 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes 1.23-1.26 +* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech) +* Red Hat OpenShift -We are currently working to support: - -* OpenShift ## Other Operators @@ -60,4 +58,4 @@ Contributions are welcome. Follow our [Contributors Guide](https://docs.stackabl ## Support -You can use this project under different licenses. Get started with the community edition! If you want professional support, [we offer subscription plans](https://stackable.tech/en/plans/). \ No newline at end of file +Get started with the community edition! If you want professional support, [we offer subscription plans and custom licensing](https://stackable.tech/en/plans/). diff --git a/Makefile b/Makefile index 54afd731..138eed0f 100644 --- a/Makefile +++ b/Makefile @@ -81,3 +81,6 @@ publish: build docker-publish helm-publish run-dev: kubectl apply -f deploy/stackable-operators-ns.yaml nix run -f. tilt -- up --port 5445 --namespace stackable-operators + +stop-dev: + nix run -f. tilt -- down diff --git a/README.md b/README.md index 768421d4..0a76925f 100644 --- a/README.md +++ b/README.md @@ -58,11 +58,9 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes 1.23-1.26 +* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech) +* Red Hat OpenShift -We are currently working to support: - -* OpenShift ## Other Operators @@ -97,4 +95,4 @@ Contributions are welcome. Follow our [Contributors Guide](https://docs.stackabl ## Support -You can use this project under different licenses. Get started with the community edition! If you want professional support, [we offer subscription plans](https://stackable.tech/en/plans/). +Get started with the community edition! If you want professional support, [we offer subscription plans and custom licensing](https://stackable.tech/en/plans/). diff --git a/docker/Dockerfile b/docker/Dockerfile index 33435438..a27847ed 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -10,7 +10,7 @@ ARG VERSION ARG RELEASE="1" LABEL name="Stackable Operator for Apache ZooKeeper" \ - maintainer="info@stackable.de" \ + maintainer="info@stackable.tech" \ vendor="Stackable GmbH" \ version="${VERSION}" \ release="${RELEASE}" \ From 8eb85fcb0d115c73f7be4539cb95e4e9e99621e4 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Thu, 13 Jul 2023 13:58:58 +0000 Subject: [PATCH 06/10] Increase the size limit of the log volume (#704) # Description Increase the size limit of the log volume. --- CHANGELOG.md | 5 ++++- Cargo.lock | 8 ++++---- rust/crd/Cargo.toml | 2 +- rust/crd/src/lib.rs | 15 ++++++++------ rust/operator-binary/Cargo.toml | 4 ++-- rust/operator-binary/src/product_logging.rs | 13 +++++++++--- rust/operator-binary/src/zk_controller.rs | 22 ++++++++++----------- 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 297feead..c732d7d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,10 +16,11 @@ All notable changes to this project will be documented in this file. ### Fixed - Missing CRD defaults for `status.conditions` field ([#682]). +- Increase the size limit of the log volume ([#704]). ### Changed -- Operator-rs: `0.40.2` -> `0.41.0` ([#673]). +- Operator-rs: `0.40.2` -> `0.44.0` ([#673], [#693], [#697], [#704]). - Use 0.0.0-dev product images for testing ([#674]) - Use testing-tools 0.2.0 ([#674]) - Run as root group ([#680]) @@ -34,9 +35,11 @@ All notable changes to this project will be documented in this file. [#689]: https://github.com/stackabletech/zookeeper-operator/pull/689 [#693]: https://github.com/stackabletech/zookeeper-operator/pull/693 [#696]: https://github.com/stackabletech/zookeeper-operator/pull/696 +[#697]: https://github.com/stackabletech/zookeeper-operator/pull/697 [#698]: https://github.com/stackabletech/zookeeper-operator/pull/698 [#699]: https://github.com/stackabletech/zookeeper-operator/pull/699 [#702]: https://github.com/stackabletech/zookeeper-operator/pull/702 +[#704]: https://github.com/stackabletech/zookeeper-operator/pull/704 ## [23.4.0] - 2023-04-17 diff --git a/Cargo.lock b/Cargo.lock index e320357a..b4875248 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,8 +1860,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.42.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.42.2#f2c3f10b9c48035751557d8065d658fa05b4de0d" +version = "0.44.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.44.0#f922369d05e709c0965098012d0fd76865004982" dependencies = [ "chrono", "clap", @@ -1894,8 +1894,8 @@ dependencies = [ [[package]] name = "stackable-operator-derive" -version = "0.42.2" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.42.2#f2c3f10b9c48035751557d8065d658fa05b4de0d" +version = "0.44.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.44.0#f922369d05e709c0965098012d0fd76865004982" dependencies = [ "darling 0.20.1", "proc-macro2", diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml index e0a511c3..667238cc 100644 --- a/rust/crd/Cargo.toml +++ b/rust/crd/Cargo.toml @@ -12,7 +12,7 @@ publish = false serde = "1.0" serde_json = "1.0" snafu = "0.7" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } strum = { version = "0.24", features = ["derive"] } tracing = "0.1" diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index 9fbe8f8d..e0bd4680 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -54,12 +54,15 @@ pub const LOG4J_CONFIG_FILE: &str = "log4j.properties"; pub const ZOOKEEPER_LOG_FILE: &str = "zookeeper.log4j.xml"; -pub const MAX_ZK_LOG_FILES_SIZE_IN_MIB: u32 = 10; -const MAX_PREPARE_LOG_FILE_SIZE_IN_MIB: u32 = 1; -// Additional buffer space is not needed, as the `prepare` container already has sufficient buffer -// space and all containers share a single volume. -pub const LOG_VOLUME_SIZE_IN_MIB: u32 = - MAX_ZK_LOG_FILES_SIZE_IN_MIB + MAX_PREPARE_LOG_FILE_SIZE_IN_MIB; +pub const MAX_ZK_LOG_FILES_SIZE: MemoryQuantity = MemoryQuantity { + value: 10.0, + unit: BinaryMultiple::Mebi, +}; +pub const MAX_PREPARE_LOG_FILE_SIZE: MemoryQuantity = MemoryQuantity { + value: 1.0, + unit: BinaryMultiple::Mebi, +}; + const JVM_HEAP_FACTOR: f32 = 0.8; pub const DOCKER_IMAGE_BASE_NAME: &str = "zookeeper"; diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 5399af99..6c112d62 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -22,10 +22,10 @@ tokio = { version = "1.28", features = ["full"] } tokio-zookeeper = "0.2" tracing = "0.1" pin-project = "1.1" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } stackable-zookeeper-crd = { path = "../crd" } [build-dependencies] built = { version = "0.6", features = ["chrono", "git2"] } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.42.2" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } stackable-zookeeper-crd = { path = "../crd" } diff --git a/rust/operator-binary/src/product_logging.rs b/rust/operator-binary/src/product_logging.rs index c0078b15..9202f830 100644 --- a/rust/operator-binary/src/product_logging.rs +++ b/rust/operator-binary/src/product_logging.rs @@ -4,6 +4,7 @@ use stackable_operator::{ client::Client, k8s_openapi::api::core::v1::ConfigMap, kube::ResourceExt, + memory::BinaryMultiple, product_logging::{ self, spec::{ContainerLogConfig, ContainerLogConfigChoice}, @@ -12,7 +13,7 @@ use stackable_operator::{ }; use stackable_zookeeper_crd::{ Container, LoggingFramework, ZookeeperCluster, ZookeeperRole, LOG4J_CONFIG_FILE, - LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE_IN_MIB, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, + LOGBACK_CONFIG_FILE, MAX_ZK_LOG_FILES_SIZE, STACKABLE_LOG_DIR, ZOOKEEPER_LOG_FILE, }; #[derive(Snafu, Debug)] @@ -103,7 +104,10 @@ pub fn extend_role_group_config_map( product_logging::framework::create_log4j_config( &format!("{STACKABLE_LOG_DIR}/zookeeper"), ZOOKEEPER_LOG_FILE, - MAX_ZK_LOG_FILES_SIZE_IN_MIB, + MAX_ZK_LOG_FILES_SIZE + .scale_to(BinaryMultiple::Mebi) + .floor() + .value as u32, CONSOLE_CONVERSION_PATTERN, log_config, ), @@ -115,7 +119,10 @@ pub fn extend_role_group_config_map( product_logging::framework::create_logback_config( &format!("{STACKABLE_LOG_DIR}/zookeeper"), ZOOKEEPER_LOG_FILE, - MAX_ZK_LOG_FILES_SIZE_IN_MIB, + MAX_ZK_LOG_FILES_SIZE + .scale_to(BinaryMultiple::Mebi) + .floor() + .value as u32, CONSOLE_CONVERSION_PATTERN, log_config, None, diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index aea87196..40867e4c 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -28,7 +28,7 @@ use stackable_operator::{ ServiceSpec, Volume, }, }, - apimachinery::pkg::{api::resource::Quantity, apis::meta::v1::LabelSelector}, + apimachinery::pkg::apis::meta::v1::LabelSelector, DeepMerge, }, kube::{api::DynamicObject, runtime::controller, Resource}, @@ -53,9 +53,9 @@ use stackable_operator::{ }; use stackable_zookeeper_crd::{ security::ZookeeperSecurity, Container, ZookeeperCluster, ZookeeperClusterStatus, - ZookeeperConfig, ZookeeperRole, DOCKER_IMAGE_BASE_NAME, LOG_VOLUME_SIZE_IN_MIB, - STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, STACKABLE_LOG_DIR, - STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, + ZookeeperConfig, ZookeeperRole, DOCKER_IMAGE_BASE_NAME, MAX_PREPARE_LOG_FILE_SIZE, + MAX_ZK_LOG_FILES_SIZE, STACKABLE_CONFIG_DIR, STACKABLE_DATA_DIR, STACKABLE_LOG_CONFIG_DIR, + STACKABLE_LOG_DIR, STACKABLE_RW_CONFIG_DIR, ZOOKEEPER_PROPERTIES_FILE, }; use std::{ borrow::Cow, @@ -752,14 +752,12 @@ fn build_server_rolegroup_statefulset( name: "rwconfig".to_string(), ..Volume::default() }) - .add_volume(Volume { - name: "log".to_string(), - empty_dir: Some(EmptyDirVolumeSource { - medium: None, - size_limit: Some(Quantity(format!("{LOG_VOLUME_SIZE_IN_MIB}Mi"))), - }), - ..Volume::default() - }) + .add_empty_dir_volume( + "log", + Some(product_logging::framework::calculate_log_volume_size_limit( + &[MAX_ZK_LOG_FILES_SIZE, MAX_PREPARE_LOG_FILE_SIZE], + )), + ) .security_context(PodSecurityContext { run_as_user: Some(ZK_UID), run_as_group: Some(0), From e049029b6fbc80c44dff84dc7b358e9fce401acb Mon Sep 17 00:00:00 2001 From: Stacky McStackface Date: Fri, 14 Jul 2023 09:33:56 +0000 Subject: [PATCH 07/10] Update templated files to rev ec01d15 (#705) Automatically created PR based on commit ec01d153883ed8bc0a34a14489a9aebcee415017 in stackabletech/operator-templating repo. Triggered by: Manual run triggered by: dervoeti with message [Sign container images in Nexus] --- .github/workflows/build.yml | 4 ++++ Makefile | 11 ++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f5f26466..fe88151e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -282,6 +282,8 @@ jobs: - tests_passed - select_helm_repo runs-on: ubuntu-latest + permissions: + id-token: write env: NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }} HELM_REPO: ${{ needs.select_helm_repo.outputs.helm_repository }} @@ -312,6 +314,8 @@ jobs: # Recreate charts and publish charts and docker image. The "-e" is needed as we want to override the # default value in the makefile if called from this action, but not otherwise (i.e. when called locally). # This is needed for the HELM_REPO variable. + - name: Set up Cosign + uses: sigstore/cosign-installer@v3.0.5 - name: Publish Docker image and Helm chart run: make -e publish # Output the name of the published image to the Job output for later use diff --git a/Makefile b/Makefile index 138eed0f..f7b233df 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,16 @@ docker-build: docker-publish: echo "${NEXUS_PASSWORD}" | docker login --username github --password-stdin "${DOCKER_REPO}" - docker push --all-tags "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}" + DOCKER_OUTPUT=$$(docker push --all-tags "${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}");\ + # Obtain the digest of the pushed image from the output of `docker push`, because signing by tag is deprecated and will be removed from cosign in the future\ + REPO_DIGEST_OF_IMAGE=$$(echo "$$DOCKER_OUTPUT" | awk '/^${VERSION}: digest: sha256:[0-9a-f]{64} size: [0-9]+$$/ { print $$3 }');\ + if [ -z "$$REPO_DIGEST_OF_IMAGE" ]; then\ + echo 'Could not find repo digest for container image: ${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:${VERSION}';\ + exit 1;\ + fi;\ + # This generates a signature and publishes it to the registry, next to the image\ + # Uses the keyless signing flow with Github Actions as identity provider\ + cosign sign -y ${DOCKER_REPO}/${ORGANIZATION}/${OPERATOR_NAME}:@$$REPO_DIGEST_OF_IMAGE # TODO remove if not used/needed docker: docker-build docker-publish From 7693d58c1bf2ce98d67e075a8438d912c2e646ee Mon Sep 17 00:00:00 2001 From: Razvan-Daniel Mihai <84674+razvan@users.noreply.github.com> Date: Fri, 14 Jul 2023 13:25:00 +0000 Subject: [PATCH 08/10] Update CHANGELOG.md from release 23.7.0 (#706) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c732d7d0..f716893c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [23.7.0] - 2023-07-14 + ### Added - Generate OLM bundle for Release 23.4.0 ([#672]). From 440f56c8fb18c78466e253d20af1bbbd63a1bb32 Mon Sep 17 00:00:00 2001 From: Stacky McStackface <95074132+stackable-bot@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:58:01 +0200 Subject: [PATCH 09/10] Generated commit to update templated files based on rev 73432ec in stackabletech/operator-templating repo. (#710) Triggered by: Manual run triggered by: lfrancke with message [Update dependencies for GitHub action and delete bors config in preparation for merge queues] --- .github/pull_request_template.md | 4 -- .github/workflows/build.yml | 61 ++++++++++++++------------ .github/workflows/daily_security.yml | 4 +- .github/workflows/reviewdog.yaml | 45 +++++++++++++------ .readme/partials/borrowed/footer.md.j2 | 2 +- README.md | 2 +- rust-toolchain.toml | 2 +- 7 files changed, 70 insertions(+), 50 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 487f724a..8f49f12c 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,9 +1,7 @@ - # Description *Please add a description here. This will become the commit message of the merge request later.* - ## Definition of Done Checklist @@ -32,5 +30,3 @@ - [ ] Feature Tracker has been updated - [ ] Proper release label has been added ``` - -Once the review is done, comment `bors r+` (or `bors merge`) to merge. [Further information](https://bors.tech/documentation/getting-started/#reviewing-pull-requests) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe88151e..4508652b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ on: tags: - '[0-9][0-9].[0-9]+.[0-9]+' pull_request: + merge_group: env: CARGO_TERM_COLOR: always @@ -35,13 +36,14 @@ jobs: run: | sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - uses: dtolnay/rust-toolchain@1.71.0 + - uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2 with: key: udeps + cache-all-crates: "true" - run: cargo install --locked cargo-udeps@0.1.39 - run: cargo udeps --workspace @@ -62,8 +64,7 @@ jobs: # repository: dev # # Any other scenarios (e.g. when a branch is created/pushed) will cause the publish step to be skipped, most commonly this is expected to happen for the - # branches that bors uses internally (staging, trying) for which the checks need to run, but we do not want artifacts - # to be published. + # branches that the GitHub merge queue feature uses internally for which the checks need to run, but we do not want artifacts to be published. select_helm_repo: name: Select target helm repository based on action trigger runs-on: ubuntu-latest @@ -102,10 +103,10 @@ jobs: continue-on-error: ${{ matrix.checks == 'advisories' }} steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: EmbarkStudios/cargo-deny-action@8a8607bd8e2b3a514d5a40174cc7c55b229d9ba7 # v1.4.0 + - uses: EmbarkStudios/cargo-deny-action@a50c7d5f86370e02fae8472c398f15a36e517bb8 # v1 with: command: check ${{ matrix.checks }} @@ -113,10 +114,10 @@ jobs: name: Run Rustfmt runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 + - uses: dtolnay/rust-toolchain@1.71.0 with: components: rustfmt - run: cargo fmt --all -- --check @@ -129,15 +130,16 @@ jobs: run: | sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 + - uses: dtolnay/rust-toolchain@1.71.0 with: components: clippy - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2 with: key: clippy + cache-all-crates: "true" - name: Run clippy action to produce annotations uses: giraffate/clippy-action@13b9d32482f25d29ead141b79e7e04e7900281e0 # v1.0.1 env: @@ -161,15 +163,16 @@ jobs: run: | sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 + - uses: dtolnay/rust-toolchain@1.71.0 with: components: rustfmt - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2 with: key: doc + cache-all-crates: "true" - run: cargo doc --document-private-items run_tests: @@ -180,13 +183,14 @@ jobs: run: | sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 - - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + - uses: dtolnay/rust-toolchain@1.71.0 + - uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2 with: key: test + cache-all-crates: "true" - run: cargo test @@ -198,10 +202,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.6.1 + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4 with: python-version: '3.11' - name: Install jinja2-cli @@ -212,7 +216,7 @@ jobs: run: git diff --exit-code - name: Git Diff showed uncommitted changes if: ${{ failure() }} - uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6 + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 with: script: | core.setFailed('Committed README are not up to date, please make sure to apply them to the templated partials, and re-commit!') @@ -236,7 +240,7 @@ jobs: sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - name: Set up Helm @@ -244,18 +248,19 @@ jobs: with: version: v3.6.2 - name: Set up cargo - uses: dtolnay/rust-toolchain@1.68.2 + uses: dtolnay/rust-toolchain@1.71.0 - name: Set up rust-cache - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0 + uses: Swatinem/rust-cache@dd05243424bd5c0e585e4b55eb2d7615cdd32f1f # v2 with: key: charts + cache-all-crates: "true" - name: Regenerate charts run: make regenerate-charts - name: Check if committed charts were up to date run: git diff --exit-code - name: Git Diff showed uncommitted changes if: ${{ failure() }} - uses: actions/github-script@d556feaca394842dc55e4734bf3bb9f685482fa0 # v6 + uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 # v6 with: script: | core.setFailed('Committed charts were not up to date, please regenerate and re-commit!') @@ -296,10 +301,10 @@ jobs: sudo apt-get update sudo apt-get install protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config - name: Checkout - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 + uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 with: submodules: recursive - - uses: dtolnay/rust-toolchain@1.68.2 + - uses: dtolnay/rust-toolchain@1.71.0 with: components: rustfmt # This step checks if the current run was triggered by a push to a pr (or a pr being created). @@ -315,7 +320,7 @@ jobs: # default value in the makefile if called from this action, but not otherwise (i.e. when called locally). # This is needed for the HELM_REPO variable. - name: Set up Cosign - uses: sigstore/cosign-installer@v3.0.5 + uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 # v3 - name: Publish Docker image and Helm chart run: make -e publish # Output the name of the published image to the Job output for later use diff --git a/.github/workflows/daily_security.yml b/.github/workflows/daily_security.yml index ca67debf..d375d291 100644 --- a/.github/workflows/daily_security.yml +++ b/.github/workflows/daily_security.yml @@ -14,7 +14,7 @@ jobs: audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1.4.1 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: rustsec/audit-check@dd51754d4e59da7395a4cd9b593f0ff2d61a9b95 # v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/reviewdog.yaml b/.github/workflows/reviewdog.yaml index 1c4bff8d..636b7f7b 100644 --- a/.github/workflows/reviewdog.yaml +++ b/.github/workflows/reviewdog.yaml @@ -13,35 +13,35 @@ jobs: actionlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: reviewdog/action-actionlint@b6feb003955cad286985c42e7047f4567a798f3f # v1.36.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-actionlint@7485c2136bd093d2317a854c72910eebaee35238 # v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} flake8: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: actions/setup-python@13ae5bb136fac2878aff31522b9efb785519f984 # v4.6.1 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4 with: python-version: "3.11" - - uses: reviewdog/action-flake8@b6435e67f0cfda225b9e0c9283cfb7ea7c551bdb # tag=v3.6.0 + - uses: reviewdog/action-flake8@1212bd6f1c67830dcff438cf39522d4b58407e71 # v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} hadolint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: reviewdog/action-hadolint@141ffd8d2f0b75e6fc7c87341331985448b62aa4 # v1.34.1 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-hadolint@7bd0800b7ce35c6d644cde762174e69f18896973 # v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} markdownlint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: reviewdog/action-markdownlint@97e3df02fe1573d505a7b268046a44fa5409cbc3 # tag=v0.9.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-markdownlint@e3a1300e4ead323f710e9b711ee269e0d29ba5ec # v0 with: github_token: ${{ secrets.GITHUB_TOKEN }} markdownlint_flags: '-i README.md .' @@ -49,15 +49,34 @@ jobs: shellcheck: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: reviewdog/action-shellcheck@f52d78284b4941028952125a10c76676c3d456eb # v1.17.0 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-shellcheck@50e5e1e2284575f23a1e409d9c0804cdfc4f6e31 # v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} yamllint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0 - - uses: reviewdog/action-yamllint@8c429dfe4fc47b1ce1fa99a64e94693880d5dc30 # tag=v1.6.1 + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-yamllint@49fe172669b506f0c688207a67b4cf93fee52699 # v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} + + misspell: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-misspell@9257f108197b44e37995c98bea6ee4a5b9ffc3b0 # v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + locale: "US" + + languagetool: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3 + - uses: reviewdog/action-languagetool@0551a7dc055989cdd75cb564ce23991717157004 # v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + level: info + patterns: "**/*.md **/*.txt **/*.adoc" diff --git a/.readme/partials/borrowed/footer.md.j2 b/.readme/partials/borrowed/footer.md.j2 index a358a0cc..a2d6a52d 100644 --- a/.readme/partials/borrowed/footer.md.j2 +++ b/.readme/partials/borrowed/footer.md.j2 @@ -21,7 +21,7 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech) +* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech)) * Red Hat OpenShift diff --git a/README.md b/README.md index 0a76925f..c96a0ddc 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ We develop and test our operators on the following cloud platforms: * GKE on Google Cloud Platform (GCP) * [IONOS Cloud Managed Kubernetes](https://cloud.ionos.com/managed/kubernetes) * K3s -* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech) +* Kubernetes (for an up to date list of supported versions please check the release notes in our [docs](https://docs.stackable.tech)) * Red Hat OpenShift diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 864d3c41..aa464261 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.68.2" +channel = "1.71.0" From 8a6dc83b5d92ba17569e18761181fbaca0156d90 Mon Sep 17 00:00:00 2001 From: Sebastian Bernauer Date: Wed, 2 Aug 2023 07:23:34 +0200 Subject: [PATCH 10/10] Default stackableVersion to operator version (#711) * Default stackableVersion to operator version * changelog * update tests * update the rest --- CHANGELOG.md | 6 ++++++ Cargo.lock | 8 ++++---- deploy/helm/zookeeper-operator/crds/crds.yaml | 6 +++--- .../examples/getting_started/code/zookeeper.yaml | 1 - .../examples/getting_started/code/zookeeper.yaml.j2 | 1 - .../example-cluster-tls-authentication.yaml | 1 - .../usage_guide/example-cluster-tls-encryption.yaml | 1 - docs/modules/zookeeper/pages/config_properties.adoc | 1 - examples/simple-zookeeper-tls-cluster.yaml | 1 - rust/crd/Cargo.toml | 2 +- rust/crd/src/affinity.rs | 2 -- rust/crd/src/lib.rs | 13 +++++-------- rust/operator-binary/Cargo.toml | 4 ++-- rust/operator-binary/src/main.rs | 1 + rust/operator-binary/src/zk_controller.rs | 5 ++++- rust/operator-binary/src/znode_controller.rs | 5 ++++- .../cluster-operation/10-install-zookeeper.yaml.j2 | 3 +-- .../cluster-operation/20-stop-zookeeper.yaml.j2 | 3 +-- .../cluster-operation/30-pause-zookeeper.yaml.j2 | 3 +-- .../cluster-operation/40-restart-zookeeper.yaml.j2 | 3 +-- .../delete-rolegroup/00-install-zookeeper.yaml.j2 | 3 +-- .../delete-rolegroup/01-remove-secondary.yaml.j2 | 3 +-- .../kuttl/logging/01-install-zookeeper.yaml.j2 | 3 +-- .../kuttl/smoke/10-install-zookeeper.yaml.j2 | 3 +-- .../kuttl/znode/00-install-zookeeper.yaml.j2 | 3 +-- tests/test-definition.yaml | 10 +++++----- 26 files changed, 44 insertions(+), 51 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f716893c..e75bcb5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +### Added + +- Default stackableVersion to operator version ([#711]). + +[#711]: https://github.com/stackabletech/zookeeper-operator/pull/711 + ## [23.7.0] - 2023-07-14 ### Added diff --git a/Cargo.lock b/Cargo.lock index b4875248..09403922 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1860,8 +1860,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.44.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.44.0#f922369d05e709c0965098012d0fd76865004982" +version = "0.45.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.45.1#94141b9cd2142050e8c976d98c56c568dc85a5bd" dependencies = [ "chrono", "clap", @@ -1894,8 +1894,8 @@ dependencies = [ [[package]] name = "stackable-operator-derive" -version = "0.44.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.44.0#f922369d05e709c0965098012d0fd76865004982" +version = "0.45.1" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=0.45.1#94141b9cd2142050e8c976d98c56c568dc85a5bd" dependencies = [ "darling 0.20.1", "proc-macro2", diff --git a/deploy/helm/zookeeper-operator/crds/crds.yaml b/deploy/helm/zookeeper-operator/crds/crds.yaml index aea50c28..81bef8b3 100644 --- a/deploy/helm/zookeeper-operator/crds/crds.yaml +++ b/deploy/helm/zookeeper-operator/crds/crds.yaml @@ -112,7 +112,6 @@ spec: - productVersion - required: - productVersion - - stackableVersion description: Desired ZooKeeper image to use. properties: custom: @@ -122,7 +121,7 @@ spec: description: Version of the product, e.g. `1.4.1`. type: string pullPolicy: - default: IfNotPresent + default: Always description: '[Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) used when pulling the Images' enum: - IfNotPresent @@ -145,7 +144,8 @@ spec: nullable: true type: string stackableVersion: - description: Stackable version of the product, e.g. 2.1.0 + description: Stackable version of the product, e.g. `23.4`, `23.4.1` or `0.0.0-dev`. If not specified, the operator will use its own version, e.g. `23.4.1`. When using a nightly operator or a pr version, it will use the nightly `0.0.0-dev` image. + nullable: true type: string type: object servers: diff --git a/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml b/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml index 56c8194e..b8cdda0f 100644 --- a/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml +++ b/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml @@ -6,7 +6,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: 0.0.0-dev servers: roleGroups: default: diff --git a/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml.j2 b/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml.j2 index 69f8faaa..b8cdda0f 100644 --- a/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml.j2 +++ b/docs/modules/zookeeper/examples/getting_started/code/zookeeper.yaml.j2 @@ -6,7 +6,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: {{ versions.zookeeper }} servers: roleGroups: default: diff --git a/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-authentication.yaml b/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-authentication.yaml index 3d6c15e7..f82e3704 100644 --- a/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-authentication.yaml +++ b/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-authentication.yaml @@ -6,7 +6,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: 0.0.0-dev clusterConfig: authentication: - authenticationClass: zk-client-tls # <1> diff --git a/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-encryption.yaml b/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-encryption.yaml index ba53e709..1c22a2e9 100644 --- a/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-encryption.yaml +++ b/docs/modules/zookeeper/examples/usage_guide/example-cluster-tls-encryption.yaml @@ -6,7 +6,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: 0.0.0-dev clusterConfig: tls: serverSecretClass: tls # <1> diff --git a/docs/modules/zookeeper/pages/config_properties.adoc b/docs/modules/zookeeper/pages/config_properties.adoc index a4c69eeb..35c9b828 100644 --- a/docs/modules/zookeeper/pages/config_properties.adoc +++ b/docs/modules/zookeeper/pages/config_properties.adoc @@ -10,7 +10,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: 0.0.0-dev servers: roleGroups: default: diff --git a/examples/simple-zookeeper-tls-cluster.yaml b/examples/simple-zookeeper-tls-cluster.yaml index 7ddc8266..b33cb0fe 100644 --- a/examples/simple-zookeeper-tls-cluster.yaml +++ b/examples/simple-zookeeper-tls-cluster.yaml @@ -6,7 +6,6 @@ metadata: spec: image: productVersion: 3.8.1 - stackableVersion: 0.0.0-dev clusterConfig: authentication: - authenticationClass: zk-client-tls diff --git a/rust/crd/Cargo.toml b/rust/crd/Cargo.toml index 667238cc..29543014 100644 --- a/rust/crd/Cargo.toml +++ b/rust/crd/Cargo.toml @@ -12,7 +12,7 @@ publish = false serde = "1.0" serde_json = "1.0" snafu = "0.7" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.45.1" } strum = { version = "0.24", features = ["derive"] } tracing = "0.1" diff --git a/rust/crd/src/affinity.rs b/rust/crd/src/affinity.rs index 63147fdf..95dd5c1e 100644 --- a/rust/crd/src/affinity.rs +++ b/rust/crd/src/affinity.rs @@ -52,7 +52,6 @@ mod tests { spec: image: productVersion: 3.8.1 - stackableVersion: 0.9.0 clusterConfig: authentication: - authenticationClass: zk-client-tls @@ -127,7 +126,6 @@ mod tests { spec: image: productVersion: 3.8.1 - stackableVersion: 0.9.0 clusterConfig: authentication: - authenticationClass: zk-client-tls diff --git a/rust/crd/src/lib.rs b/rust/crd/src/lib.rs index e0bd4680..e7fe5ab8 100644 --- a/rust/crd/src/lib.rs +++ b/rust/crd/src/lib.rs @@ -67,6 +67,10 @@ const JVM_HEAP_FACTOR: f32 = 0.8; pub const DOCKER_IMAGE_BASE_NAME: &str = "zookeeper"; +mod built_info { + pub const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); +} + #[derive(Snafu, Debug)] pub enum Error { #[snafu(display("object has no namespace associated"))] @@ -434,7 +438,7 @@ impl ZookeeperCluster { let version = self .spec .image - .resolve(DOCKER_IMAGE_BASE_NAME) + .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION) .product_version; let zookeeper_versions_with_log4j = [ "1.", "2.", "3.0.", "3.1.", "3.2.", "3.3.", "3.4.", "3.5.", "3.6.", "3.7.", @@ -716,7 +720,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" "#; let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); assert_eq!( @@ -736,7 +739,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" clusterConfig: tls: serverSecretClass: simple-zookeeper-client-tls @@ -760,7 +762,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" clusterConfig: tls: serverSecretClass: null @@ -780,7 +781,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" clusterConfig: tls: quorumSecretClass: simple-zookeeper-quorum-tls @@ -806,7 +806,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" "#; let zookeeper: ZookeeperCluster = serde_yaml::from_str(input).expect("illegal test input"); @@ -827,7 +826,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" clusterConfig: tls: quorumSecretClass: simple-zookeeper-quorum-tls @@ -850,7 +848,6 @@ mod tests { spec: image: productVersion: "3.8.1" - stackableVersion: "0.0.0-dev" clusterConfig: tls: serverSecretClass: simple-zookeeper-server-tls diff --git a/rust/operator-binary/Cargo.toml b/rust/operator-binary/Cargo.toml index 6c112d62..53a47768 100644 --- a/rust/operator-binary/Cargo.toml +++ b/rust/operator-binary/Cargo.toml @@ -22,10 +22,10 @@ tokio = { version = "1.28", features = ["full"] } tokio-zookeeper = "0.2" tracing = "0.1" pin-project = "1.1" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.45.1" } stackable-zookeeper-crd = { path = "../crd" } [build-dependencies] built = { version = "0.6", features = ["chrono", "git2"] } -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.44.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "0.45.1" } stackable-zookeeper-crd = { path = "../crd" } diff --git a/rust/operator-binary/src/main.rs b/rust/operator-binary/src/main.rs index 652fa31f..f033d480 100644 --- a/rust/operator-binary/src/main.rs +++ b/rust/operator-binary/src/main.rs @@ -26,6 +26,7 @@ use std::sync::Arc; mod built_info { include!(concat!(env!("OUT_DIR"), "/built.rs")); pub const TARGET_PLATFORM: Option<&str> = option_env!("TARGET"); + pub const CARGO_PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); } #[derive(clap::Parser)] diff --git a/rust/operator-binary/src/zk_controller.rs b/rust/operator-binary/src/zk_controller.rs index 40867e4c..82af505c 100644 --- a/rust/operator-binary/src/zk_controller.rs +++ b/rust/operator-binary/src/zk_controller.rs @@ -231,7 +231,10 @@ pub async fn reconcile_zk(zk: Arc, ctx: Arc) -> Result { let zk = zk?; - let resolved_product_image = zk.spec.image.resolve(DOCKER_IMAGE_BASE_NAME); + let resolved_product_image = zk + .spec + .image + .resolve(DOCKER_IMAGE_BASE_NAME, crate::built_info::CARGO_PKG_VERSION); reconcile_apply(client, &znode, Ok(zk), &znode_path, &resolved_product_image) .await } diff --git a/tests/templates/kuttl/cluster-operation/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/cluster-operation/10-install-zookeeper.yaml.j2 index 6c17c391..dfaed57f 100644 --- a/tests/templates/kuttl/cluster-operation/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/10-install-zookeeper.yaml.j2 @@ -14,8 +14,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" {% if lookup('env', 'VECTOR_AGGREGATOR') %} clusterConfig: logging: diff --git a/tests/templates/kuttl/cluster-operation/20-stop-zookeeper.yaml.j2 b/tests/templates/kuttl/cluster-operation/20-stop-zookeeper.yaml.j2 index 6d53b9f0..70f494b6 100644 --- a/tests/templates/kuttl/cluster-operation/20-stop-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/20-stop-zookeeper.yaml.j2 @@ -5,8 +5,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" {% if lookup('env', 'VECTOR_AGGREGATOR') %} clusterConfig: logging: diff --git a/tests/templates/kuttl/cluster-operation/30-pause-zookeeper.yaml.j2 b/tests/templates/kuttl/cluster-operation/30-pause-zookeeper.yaml.j2 index b710f5f6..7ba6b208 100644 --- a/tests/templates/kuttl/cluster-operation/30-pause-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/30-pause-zookeeper.yaml.j2 @@ -5,8 +5,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" {% if lookup('env', 'VECTOR_AGGREGATOR') %} clusterConfig: logging: diff --git a/tests/templates/kuttl/cluster-operation/40-restart-zookeeper.yaml.j2 b/tests/templates/kuttl/cluster-operation/40-restart-zookeeper.yaml.j2 index c3479e93..8d527ff2 100644 --- a/tests/templates/kuttl/cluster-operation/40-restart-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/cluster-operation/40-restart-zookeeper.yaml.j2 @@ -5,8 +5,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" {% if lookup('env', 'VECTOR_AGGREGATOR') %} clusterConfig: logging: diff --git a/tests/templates/kuttl/delete-rolegroup/00-install-zookeeper.yaml.j2 b/tests/templates/kuttl/delete-rolegroup/00-install-zookeeper.yaml.j2 index 3475e1dd..7eaee22c 100644 --- a/tests/templates/kuttl/delete-rolegroup/00-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/delete-rolegroup/00-install-zookeeper.yaml.j2 @@ -14,8 +14,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper'] }}" clusterConfig: tls: serverSecretClass: null diff --git a/tests/templates/kuttl/delete-rolegroup/01-remove-secondary.yaml.j2 b/tests/templates/kuttl/delete-rolegroup/01-remove-secondary.yaml.j2 index 5a8744e9..75f595a1 100644 --- a/tests/templates/kuttl/delete-rolegroup/01-remove-secondary.yaml.j2 +++ b/tests/templates/kuttl/delete-rolegroup/01-remove-secondary.yaml.j2 @@ -5,8 +5,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper'] }}" clusterConfig: tls: serverSecretClass: null diff --git a/tests/templates/kuttl/logging/01-install-zookeeper.yaml.j2 b/tests/templates/kuttl/logging/01-install-zookeeper.yaml.j2 index 9ee82a63..f11fe03c 100644 --- a/tests/templates/kuttl/logging/01-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/logging/01-install-zookeeper.yaml.j2 @@ -28,8 +28,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper'] }}" clusterConfig: logging: vectorAggregatorConfigMapName: zookeeper-vector-aggregator-discovery diff --git a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 index 950c68ce..14e7088b 100644 --- a/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/smoke/10-install-zookeeper.yaml.j2 @@ -14,8 +14,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper'] }}" clusterConfig: {% if test_scenario['values']['use-server-tls'] == 'true' %} tls: diff --git a/tests/templates/kuttl/znode/00-install-zookeeper.yaml.j2 b/tests/templates/kuttl/znode/00-install-zookeeper.yaml.j2 index 91519882..32c6d23f 100644 --- a/tests/templates/kuttl/znode/00-install-zookeeper.yaml.j2 +++ b/tests/templates/kuttl/znode/00-install-zookeeper.yaml.j2 @@ -14,8 +14,7 @@ metadata: name: test-zk spec: image: - productVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[0] }}" - stackableVersion: "{{ test_scenario['values']['zookeeper-latest'].split('-stackable')[1] }}" + productVersion: "{{ test_scenario['values']['zookeeper-latest'] }}" {% if lookup('env', 'VECTOR_AGGREGATOR') %} clusterConfig: logging: diff --git a/tests/test-definition.yaml b/tests/test-definition.yaml index 3ae430b0..ec2a1618 100644 --- a/tests/test-definition.yaml +++ b/tests/test-definition.yaml @@ -2,13 +2,13 @@ dimensions: - name: zookeeper values: - - 3.5.8-stackable0.0.0-dev - - 3.6.3-stackable0.0.0-dev - - 3.7.0-stackable0.0.0-dev - - 3.8.1-stackable0.0.0-dev + - 3.5.8 + - 3.6.3 + - 3.7.0 + - 3.8.1 - name: zookeeper-latest values: - - 3.8.1-stackable0.0.0-dev + - 3.8.1 - name: use-server-tls values: - "true"