Skip to content

Commit c71d3e3

Browse files
committed
Patch op-rs version to use one that fixes SUP-148.
1 parent 386350a commit c71d3e3

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ tokio = { version = "1.40", features = ["full"] }
2929
tokio-zookeeper = "0.4"
3030
tracing = "0.1"
3131

32+
[patch."https://github.com/stackabletech/operator-rs.git"]
33+
stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "fix/SUP-148" }
34+
3235
# [patch."https://github.com/stackabletech/operator-rs.git"]
3336
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }
3437

rust/operator-binary/src/zk_controller.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ use stackable_operator::{
2323
pod::{container::ContainerBuilder, resources::ResourceRequirementsBuilder, PodBuilder},
2424
},
2525
cluster_resources::{ClusterResourceApplyStrategy, ClusterResources},
26-
commons::{
27-
product_image_selection::ResolvedProductImage,
28-
rbac::{build_rbac_resources, service_account_name},
29-
},
26+
commons::{product_image_selection::ResolvedProductImage, rbac::build_rbac_resources},
3027
k8s_openapi::{
3128
api::{
3229
apps::v1::{StatefulSet, StatefulSetSpec},
3330
core::v1::{
3431
ConfigMap, ConfigMapVolumeSource, EmptyDirVolumeSource, EnvVar, EnvVarSource,
35-
ExecAction, ObjectFieldSelector, PodSecurityContext, Probe, Service, ServicePort,
36-
ServiceSpec, Volume,
32+
ExecAction, ObjectFieldSelector, PodSecurityContext, Probe, Service,
33+
ServiceAccount, ServicePort, ServiceSpec, Volume,
3734
},
3835
},
3936
apimachinery::pkg::apis::meta::v1::LabelSelector,
@@ -43,7 +40,7 @@ use stackable_operator::{
4340
api::DynamicObject,
4441
core::{error_boundary, DeserializeGuard},
4542
runtime::controller,
46-
Resource,
43+
Resource, ResourceExt,
4744
},
4845
kvp::{Label, LabelError, Labels},
4946
logging::controller::ReconcilerError,
@@ -395,7 +392,7 @@ pub async fn reconcile_zk(
395392
.context(BuildRbacResourcesSnafu)?;
396393

397394
cluster_resources
398-
.add(client, rbac_sa)
395+
.add(client, rbac_sa.clone())
399396
.await
400397
.context(ApplyServiceAccountSnafu)?;
401398

@@ -444,6 +441,7 @@ pub async fn reconcile_zk(
444441
&zookeeper_security,
445442
&resolved_product_image,
446443
&merged_config,
444+
&rbac_sa,
447445
)?;
448446
cluster_resources
449447
.add(client, rg_service)
@@ -757,6 +755,7 @@ fn build_server_rolegroup_statefulset(
757755
zookeeper_security: &ZookeeperSecurity,
758756
resolved_product_image: &ResolvedProductImage,
759757
config: &ZookeeperConfig,
758+
service_account: &ServiceAccount,
760759
) -> Result<StatefulSet> {
761760
let role = zk.role(zk_role).context(InternalOperatorFailureSnafu)?;
762761
let rolegroup = zk
@@ -964,7 +963,7 @@ fn build_server_rolegroup_statefulset(
964963
fs_group: Some(1000),
965964
..PodSecurityContext::default()
966965
})
967-
.service_account_name(service_account_name(APP_NAME));
966+
.service_account_name(service_account.name_any());
968967

969968
if let Some(ContainerLogConfig {
970969
choice:

0 commit comments

Comments
 (0)