From c00cd970ed3c79295694ebf2df986d0853eb1caf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Thu, 5 Sep 2024 16:45:47 +0200 Subject: [PATCH 1/5] Add listener volume scope for secret volume builders See https://docs.stackable.tech/home/stable/secret-operator/scope#listener-volume --- crates/stackable-operator/src/builder/pod/volume.rs | 7 +++++++ crates/stackable-operator/src/commons/secret_class.rs | 11 ++++++++++- crates/stackable-operator/src/kvp/annotation/mod.rs | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/crates/stackable-operator/src/builder/pod/volume.rs b/crates/stackable-operator/src/builder/pod/volume.rs index fdc149ed2..7396c973f 100644 --- a/crates/stackable-operator/src/builder/pod/volume.rs +++ b/crates/stackable-operator/src/builder/pod/volume.rs @@ -309,6 +309,12 @@ impl SecretOperatorVolumeSourceBuilder { self } + pub fn with_listener_volume_scope(&mut self, name: impl Into) -> &mut Self { + self.scopes + .push(SecretOperatorVolumeScope::ListenerVolume { name: name.into() }); + self + } + pub fn with_format(&mut self, format: SecretFormat) -> &mut Self { self.format = Some(format); self @@ -394,6 +400,7 @@ pub enum SecretOperatorVolumeScope { Node, Pod, Service { name: String }, + ListenerVolume { name: String }, } /// Reference to a listener class or listener name diff --git a/crates/stackable-operator/src/commons/secret_class.rs b/crates/stackable-operator/src/commons/secret_class.rs index a3e4825ec..4f82790e9 100644 --- a/crates/stackable-operator/src/commons/secret_class.rs +++ b/crates/stackable-operator/src/commons/secret_class.rs @@ -52,6 +52,9 @@ impl SecretClassVolume { for service in &scope.services { secret_operator_volume_builder.with_service_scope(service); } + for listener_volume in &scope.listener_volumes { + secret_operator_volume_builder.with_listener_volume_scope(listener_volume); + } } secret_operator_volume_builder @@ -84,6 +87,11 @@ pub struct SecretClassVolumeScope { /// This should typically correspond to Service objects that the Pod participates in. #[serde(default)] pub services: Vec, + + /// The listener volume scope allows Node and Service scopes to be inferred from the applicable listeners. + /// This must correspond to Volume names in the Pod that mount Listeners. + #[serde(default)] + pub listener_volumes: Vec, } #[cfg(test)] @@ -99,6 +107,7 @@ mod tests { pod: true, node: false, services: vec!["myservice".to_string()], + listener_volumes: vec!["mylistener".to_string()], }), } .to_ephemeral_volume_source() @@ -111,7 +120,7 @@ mod tests { ), ( "secrets.stackable.tech/scope".to_string(), - "pod,service=myservice".to_string(), + "pod,service=myservice,listener-volume=mylistener".to_string(), ), ]); diff --git a/crates/stackable-operator/src/kvp/annotation/mod.rs b/crates/stackable-operator/src/kvp/annotation/mod.rs index ce8a4e784..295a4ec88 100644 --- a/crates/stackable-operator/src/kvp/annotation/mod.rs +++ b/crates/stackable-operator/src/kvp/annotation/mod.rs @@ -104,6 +104,10 @@ impl Annotation { value.push_str("service="); value.push_str(name); } + SecretOperatorVolumeScope::ListenerVolume { name } => { + value.push_str("listener-volume="); + value.push_str(name); + } } } From ce6513096b1f7a5b35464fe7dfa6aeacd36ce7cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Thu, 5 Sep 2024 16:56:08 +0200 Subject: [PATCH 2/5] changelog --- crates/stackable-operator/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index f69cabee6..76406e8a9 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Add `Hostname` and `KerberosRealmName` types extracted from secret-operator ([#851]). +- Add support for listener volume scopes to `SecretOperatorVolumeSourceBuilder` ([#855]). ### Changed @@ -20,6 +21,7 @@ All notable changes to this project will be documented in this file. [#846]: https://github.com/stackabletech/operator-rs/pull/846 [#851]: https://github.com/stackabletech/operator-rs/pull/851 [#855]: https://github.com/stackabletech/operator-rs/pull/855 +[#855]: https://github.com/stackabletech/operator-rs/pull/855 ## [0.74.0] - 2024-08-22 From 67e10ed028acb33927147bc37f6ad86b784ef056 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Thu, 5 Sep 2024 16:59:07 +0200 Subject: [PATCH 3/5] remove duplicated link --- crates/stackable-operator/CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 76406e8a9..1285da3fd 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -21,7 +21,6 @@ All notable changes to this project will be documented in this file. [#846]: https://github.com/stackabletech/operator-rs/pull/846 [#851]: https://github.com/stackabletech/operator-rs/pull/851 [#855]: https://github.com/stackabletech/operator-rs/pull/855 -[#855]: https://github.com/stackabletech/operator-rs/pull/855 ## [0.74.0] - 2024-08-22 From d1fcfe700f92325cd5cba805177978be6dbea3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Thu, 5 Sep 2024 16:59:52 +0200 Subject: [PATCH 4/5] Because I'm dumb and linked to the wrong PR --- crates/stackable-operator/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index 1285da3fd..f925ed94a 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -7,7 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - Add `Hostname` and `KerberosRealmName` types extracted from secret-operator ([#851]). -- Add support for listener volume scopes to `SecretOperatorVolumeSourceBuilder` ([#855]). +- Add support for listener volume scopes to `SecretOperatorVolumeSourceBuilder` ([#858]). ### Changed @@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file. [#846]: https://github.com/stackabletech/operator-rs/pull/846 [#851]: https://github.com/stackabletech/operator-rs/pull/851 [#855]: https://github.com/stackabletech/operator-rs/pull/855 +[#858]: https://github.com/stackabletech/operator-rs/pull/858 ## [0.74.0] - 2024-08-22 From 674b9b96ab3c2fa96ce7f1d45bf8ffa40bf56fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Natalie=20Klestrup=20R=C3=B6ijezon?= Date: Fri, 6 Sep 2024 14:30:56 +0200 Subject: [PATCH 5/5] Fix old changelog formatting errors --- crates/stackable-operator/CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/stackable-operator/CHANGELOG.md b/crates/stackable-operator/CHANGELOG.md index f925ed94a..0eed91c73 100644 --- a/crates/stackable-operator/CHANGELOG.md +++ b/crates/stackable-operator/CHANGELOG.md @@ -74,7 +74,6 @@ All notable changes to this project will be documented in this file. [#821]: https://github.com/stackabletech/operator-rs/pull/821 [#827]: https://github.com/stackabletech/operator-rs/pull/827 -[#840]: https://github.com/stackabletech/operator-rs/pull/840 ## [0.71.0] - 2024-07-29 @@ -518,9 +517,6 @@ Only rust documentation was changed. - `PodListeners` CRD ([#644]). - Add support for tls pkcs12 password to secret operator volume builder ([#645]). -[#644]: https://github.com/stackabletech/operator-rs/pull/644 -[#645]: https://github.com/stackabletech/operator-rs/pull/645 - ### Changed - Derive `Eq` and `Copy` where applicable for listener CRDs ([#644]). @@ -1187,7 +1183,7 @@ This is a rerelease of 0.25.1 which some last-minute incompatible API changes to ### Changed -- BREAKING: kube 0.68 -> 0.69.1 ([#319, [#322]]). +- BREAKING: kube 0.68 -> 0.69.1 ([#319], [#322]). ### Removed