Skip to content

Commit e6cc626

Browse files
committed
Patch op-rs version to use one that fixes SUP-148.
Some minor changes needed to remove dependency on now private fn in op-rs.
1 parent 3b284f4 commit e6cc626

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
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
@@ -30,5 +30,8 @@ strum = { version = "0.26", features = ["derive"] }
3030
tokio = { version = "1.40", features = ["full"] }
3131
tracing = "0.1"
3232

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

rust/operator-binary/src/druid_controller.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use stackable_operator::{
3535
commons::{
3636
opa::OpaApiVersion,
3737
product_image_selection::ResolvedProductImage,
38-
rbac::{build_rbac_resources, service_account_name},
38+
rbac::build_rbac_resources,
3939
s3::{S3AccessStyle, S3ConnectionSpec, S3Error},
4040
tls_verification::TlsClientDetailsError,
4141
},
@@ -70,6 +70,8 @@ use stackable_operator::{
7070
},
7171
time::Duration,
7272
};
73+
use stackable_operator::k8s_openapi::api::core::v1::ServiceAccount;
74+
use stackable_operator::kube::ResourceExt;
7375
use strum::{EnumDiscriminants, IntoStaticStr};
7476

7577
use crate::{
@@ -488,7 +490,8 @@ pub async fn reconcile_druid(
488490
)
489491
.context(BuildRbacResourcesSnafu)?;
490492
cluster_resources
491-
.add(client, rbac_sa)
493+
// We clone rbac_sa because we need to reuse it below
494+
.add(client, rbac_sa.clone())
492495
.await
493496
.context(ApplyServiceAccountSnafu)?;
494497
cluster_resources
@@ -559,6 +562,7 @@ pub async fn reconcile_druid(
559562
s3_conn.as_ref(),
560563
&druid_tls_security,
561564
&druid_auth_config,
565+
&rbac_sa,
562566
)?;
563567
cluster_resources
564568
.add(client, rg_service)
@@ -916,6 +920,7 @@ fn build_rolegroup_statefulset(
916920
s3_conn: Option<&S3ConnectionSpec>,
917921
druid_tls_security: &DruidTlsSecurity,
918922
druid_auth_config: &Option<DruidAuthenticationConfig>,
923+
service_account: &ServiceAccount,
919924
) -> Result<StatefulSet> {
920925
// prepare container builder
921926
let prepare_container_name = Container::Prepare.to_string();
@@ -1119,7 +1124,7 @@ fn build_rolegroup_statefulset(
11191124
.add_init_container(cb_prepare.build())
11201125
.add_container(cb_druid.build())
11211126
.metadata(metadata)
1122-
.service_account_name(service_account_name(APP_NAME))
1127+
.service_account_name(service_account.name_any())
11231128
.security_context(
11241129
PodSecurityContextBuilder::new()
11251130
.run_as_user(DRUID_UID)

0 commit comments

Comments
 (0)