Skip to content

Commit 05ada01

Browse files
committed
use listener scope for tls
1 parent bb49f43 commit 05ada01

4 files changed

Lines changed: 8 additions & 5 deletions

File tree

rust/operator-binary/src/controller.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,12 +1346,10 @@ async fn build_node_rolegroup_statefulset(
13461346
build_tls_volume(
13471347
nifi,
13481348
KEYSTORE_VOLUME_NAME,
1349-
vec![
1350-
&nifi_cluster_name,
1351-
&build_reporting_task_service_name(&nifi_cluster_name),
1352-
],
1349+
vec![&build_reporting_task_service_name(&nifi_cluster_name)],
13531350
SecretFormat::TlsPkcs12,
13541351
&requested_secret_lifetime,
1352+
LISTENER_VOLUME_NAME,
13551353
)
13561354
.context(SecuritySnafu)?,
13571355
)

rust/operator-binary/src/reporting_task/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ use stackable_operator::{
5151
use crate::{
5252
controller::build_recommended_labels,
5353
crd::{APP_NAME, HTTPS_PORT, HTTPS_PORT_NAME, METRICS_PORT, NifiRole, v1alpha1},
54+
listener::LISTENER_VOLUME_NAME,
5455
security::{
5556
authentication::{NifiAuthenticationConfig, STACKABLE_ADMIN_USERNAME},
5657
build_tls_volume,
@@ -356,6 +357,7 @@ fn build_reporting_task_job(
356357
// There is no correct way to configure this job since it's an implementation detail.
357358
// Also it will be dropped when support for 1.x is removed.
358359
&Duration::from_days_unchecked(1),
360+
LISTENER_VOLUME_NAME,
359361
)
360362
.context(SecretVolumeBuildFailureSnafu)?,
361363
)

rust/operator-binary/src/security/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ pub fn build_tls_volume(
5050
service_scopes: Vec<&str>,
5151
secret_format: SecretFormat,
5252
requested_secret_lifetime: &Duration,
53+
listener_scope: &str,
5354
) -> Result<Volume> {
5455
tls::build_tls_volume(
5556
nifi,
5657
volume_name,
5758
service_scopes,
5859
secret_format,
5960
requested_secret_lifetime,
61+
listener_scope,
6062
)
6163
.context(TlsSnafu)
6264
}

rust/operator-binary/src/security/tls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ pub(crate) fn build_tls_volume(
2727
service_scopes: Vec<&str>,
2828
secret_format: SecretFormat,
2929
requested_secret_lifetime: &Duration,
30+
listener_scope: &str,
3031
) -> Result<Volume> {
3132
let mut secret_volume_source_builder =
3233
SecretOperatorVolumeSourceBuilder::new(nifi.server_tls_secret_class());
@@ -42,8 +43,8 @@ pub(crate) fn build_tls_volume(
4243
Ok(VolumeBuilder::new(volume_name)
4344
.ephemeral(
4445
secret_volume_source_builder
45-
.with_node_scope()
4646
.with_pod_scope()
47+
.with_listener_volume_scope(listener_scope)
4748
.with_format(secret_format)
4849
.with_auto_tls_cert_lifetime(*requested_secret_lifetime)
4950
.build()

0 commit comments

Comments
 (0)