From ce2d1b8e1e2eef7049440d56735b71575aa8d4da Mon Sep 17 00:00:00 2001 From: Malte Sander Date: Fri, 22 Nov 2024 16:09:16 +0100 Subject: [PATCH 1/3] Patch op-rs version to use one that fixes SUP-148. --- Cargo.lock | 8 +++---- Cargo.toml | 3 +++ rust/operator-binary/src/hbase_controller.rs | 22 +++++++++++--------- 3 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93f88c98..a457c4dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2210,8 +2210,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.80.0" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" +version = "0.81.0" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" dependencies = [ "chrono", "clap", @@ -2249,7 +2249,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" dependencies = [ "darling", "proc-macro2", @@ -2260,7 +2260,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.1" -source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#6fbe32300b60f95e0baa2ab0ff2daf961b06531c" +source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" dependencies = [ "kube", "semver", diff --git a/Cargo.toml b/Cargo.toml index ee6a214d..46d97ef2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,5 +27,8 @@ strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } tracing = "0.1" +[patch."https://github.com/stackabletech/operator-rs.git"] +stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "fix/SUP-148" } + #[patch."https://github.com/stackabletech/operator-rs.git"] #stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } diff --git a/rust/operator-binary/src/hbase_controller.rs b/rust/operator-binary/src/hbase_controller.rs index 5e62d57e..24c2700b 100644 --- a/rust/operator-binary/src/hbase_controller.rs +++ b/rust/operator-binary/src/hbase_controller.rs @@ -24,23 +24,23 @@ use stackable_operator::{ }, }, cluster_resources::{ClusterResourceApplyStrategy, ClusterResources}, - commons::{ - product_image_selection::ResolvedProductImage, - rbac::{build_rbac_resources, service_account_name}, - }, + commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources}, k8s_openapi::{ api::{ apps::v1::{StatefulSet, StatefulSetSpec}, core::v1::{ - ConfigMap, ConfigMapVolumeSource, ContainerPort, Probe, Service, ServicePort, - ServiceSpec, TCPSocketAction, Volume, + ConfigMap, ConfigMapVolumeSource, ContainerPort, Probe, Service, ServiceAccount, + ServicePort, ServiceSpec, TCPSocketAction, Volume, }, }, apimachinery::pkg::{apis::meta::v1::LabelSelector, util::intstr::IntOrString}, DeepMerge, }, - kube::core::{error_boundary, DeserializeGuard}, - kube::{runtime::controller::Action, Resource}, + kube::{ + core::{error_boundary, DeserializeGuard}, + runtime::controller::Action, + Resource, ResourceExt, + }, kvp::{Label, LabelError, Labels, ObjectLabels}, logging::controller::ReconcilerError, memory::{BinaryMultiple, MemoryQuantity}, @@ -407,7 +407,7 @@ pub async fn reconcile_hbase( ) .context(BuildRbacResourcesSnafu)?; cluster_resources - .add(client, rbac_sa) + .add(client, rbac_sa.clone()) .await .context(ApplyServiceAccountSnafu)?; cluster_resources @@ -452,6 +452,7 @@ pub async fn reconcile_hbase( rolegroup_config, &merged_config, &resolved_product_image, + &rbac_sa, )?; cluster_resources .add(client, rg_service) @@ -778,6 +779,7 @@ fn build_rolegroup_statefulset( rolegroup_config: &HashMap>, config: &HbaseConfig, resolved_product_image: &ResolvedProductImage, + service_account: &ServiceAccount, ) -> Result { let hbase_version = &resolved_product_image.app_version_label; @@ -943,7 +945,7 @@ fn build_rolegroup_statefulset( )), ) .context(AddVolumeSnafu)? - .service_account_name(service_account_name(APP_NAME)) + .service_account_name(service_account.name_any()) .security_context( PodSecurityContextBuilder::new() .run_as_user(HBASE_UID) From 33526b15d6bc9b5115616083615be7ea71b81923 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Liebau?= Date: Sun, 24 Nov 2024 21:53:31 +0100 Subject: [PATCH 2/3] Updated changelog Use op-rs 0.82 instead of PR branch. --- CHANGELOG.md | 2 ++ Cargo.lock | 8 ++++---- Cargo.toml | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index eafc78ed..ac35833a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ - Implement `envOverrides` for HbaseCluster ([#550]). - Omid test: use 1.1.2, update default port number and raise test timeout ([#556]). - An invalid `HBaseCluster` doesn't cause the operator to stop functioning (#[575]). +- BREAKING: Use distinct ServiceAccounts for the Stacklets, so that multiple Stacklets can be deployed in one namespace. Existing Stacklets will use the newly created ServiceAccounts after restart ([#594]). ### Removed @@ -32,6 +33,7 @@ [#558]: https://github.com/stackabletech/hbase-operator/pull/558 [#574]: https://github.com/stackabletech/hbase-operator/pull/574 [#584]: https://github.com/stackabletech/hbase-operator/pull/584 +[#594]: https://github.com/stackabletech/hbase-operator/pull/594 ## [24.7.0] - 2024-07-24 diff --git a/Cargo.lock b/Cargo.lock index a457c4dc..ba92b419 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2210,8 +2210,8 @@ dependencies = [ [[package]] name = "stackable-operator" -version = "0.81.0" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" +version = "0.82.0" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#415bbd031bd52e9c0c5392060235030e9930b46b" dependencies = [ "chrono", "clap", @@ -2249,7 +2249,7 @@ dependencies = [ [[package]] name = "stackable-operator-derive" version = "0.3.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#415bbd031bd52e9c0c5392060235030e9930b46b" dependencies = [ "darling", "proc-macro2", @@ -2260,7 +2260,7 @@ dependencies = [ [[package]] name = "stackable-shared" version = "0.0.1" -source = "git+https://github.com/stackabletech//operator-rs.git?branch=fix/SUP-148#c219c2a0fd63ffac17738f9c869239f5772681cf" +source = "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#415bbd031bd52e9c0c5392060235030e9930b46b" dependencies = [ "kube", "semver", diff --git a/Cargo.toml b/Cargo.toml index 46d97ef2..b963f40b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,14 +21,11 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" serde_yaml = "0.9" snafu = "0.8" -stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.80.0" } +stackable-operator = { git = "https://github.com/stackabletech/operator-rs.git", tag = "stackable-operator-0.82.0" } product-config = { git = "https://github.com/stackabletech/product-config.git", tag = "0.7.0" } strum = { version = "0.26", features = ["derive"] } tokio = { version = "1.40", features = ["full"] } tracing = "0.1" -[patch."https://github.com/stackabletech/operator-rs.git"] -stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "fix/SUP-148" } - #[patch."https://github.com/stackabletech/operator-rs.git"] #stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" } From c8810d1d980f0ec0c7ec039e9c0d0022a7ca6919 Mon Sep 17 00:00:00 2001 From: Siegfried Weber Date: Mon, 25 Nov 2024 11:37:58 +0100 Subject: [PATCH 3/3] Regenerate Nix files --- Cargo.nix | 14 +++++++------- crate-hashes.json | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.nix b/Cargo.nix index 693e415a..ba4ed259 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -6827,13 +6827,13 @@ rec { }; "stackable-operator" = rec { crateName = "stackable-operator"; - version = "0.80.0"; + version = "0.82.0"; edition = "2021"; workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6fbe32300b60f95e0baa2ab0ff2daf961b06531c"; - sha256 = "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3"; + rev = "415bbd031bd52e9c0c5392060235030e9930b46b"; + sha256 = "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy"; }; libName = "stackable_operator"; authors = [ @@ -6990,8 +6990,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6fbe32300b60f95e0baa2ab0ff2daf961b06531c"; - sha256 = "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3"; + rev = "415bbd031bd52e9c0c5392060235030e9930b46b"; + sha256 = "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy"; }; procMacro = true; libName = "stackable_operator_derive"; @@ -7025,8 +7025,8 @@ rec { workspace_member = null; src = pkgs.fetchgit { url = "https://github.com/stackabletech/operator-rs.git"; - rev = "6fbe32300b60f95e0baa2ab0ff2daf961b06531c"; - sha256 = "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3"; + rev = "415bbd031bd52e9c0c5392060235030e9930b46b"; + sha256 = "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy"; }; libName = "stackable_shared"; authors = [ diff --git a/crate-hashes.json b/crate-hashes.json index 562fb18b..0ca37e6e 100644 --- a/crate-hashes.json +++ b/crate-hashes.json @@ -1,6 +1,6 @@ { - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#stackable-operator-derive@0.3.1": "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#stackable-operator@0.80.0": "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3", - "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.80.0#stackable-shared@0.0.1": "16jrq3wdwz63210jgmqbx3snrr15wxw6l1smqhzv7b7jpq8qvya3", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#stackable-operator-derive@0.3.1": "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#stackable-operator@0.82.0": "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy", + "git+https://github.com/stackabletech/operator-rs.git?tag=stackable-operator-0.82.0#stackable-shared@0.0.1": "0phasjwb64rxgn5hs8vks92icmx9255bd5v9dms280clrfpcg4hy", "git+https://github.com/stackabletech/product-config.git?tag=0.7.0#product-config@0.7.0": "0gjsm80g6r75pm3824dcyiz4ysq1ka4c1if6k1mjm9cnd5ym0gny" } \ No newline at end of file