@@ -140,19 +140,18 @@ pub struct SecretVolumeSelector {
140140 pub cert_manager_cert_lifetime : Option < Duration > ,
141141
142142 // TODO (@Techassi): Name to be decided. Will potentially be renamed.
143- /// Only provision non-sensitive secret data.
143+ /// Configure to either only provision public data or public + private data.
144+ ///
145+ /// The following pieces of data are considered public/non-senstive:
144146 ///
145147 /// - TLS (PEM): Only provision the `ca.crt` file
146148 /// - TLS (PKCS#12): Only provision the `truststore.p12` file
147149 /// - Kerberos: Only provision the `krb5.conf` file
148150 ///
149- /// This defaults to `false` to be backwords compatible with behaviour before SDP 26.3.0.
150- #[ serde(
151- rename = "secrets.stackable.tech/only-provision-identity" ,
152- deserialize_with = "SecretVolumeSelector::deserialize_str_as_bool" ,
153- default
154- ) ]
155- pub only_provision_identity : bool ,
151+ /// This defaults to [`ProvisionParts::PublicPrivate`] to be backwords compatible with behaviour
152+ /// before SDP 26.3.0.
153+ #[ serde( rename = "secrets.stackable.tech/provision-parts" , default ) ]
154+ pub provision_parts : ProvisionParts ,
156155}
157156
158157/// Configuration provided by the [`TrustStore`] selecting what trust data should be provided.
@@ -161,6 +160,19 @@ pub struct TrustSelector {
161160 pub namespace : String ,
162161}
163162
163+ /// Contains options available for the `secrets.stackable.tech/provision-parts` annotation.
164+ #[ derive( Debug , Default , PartialEq , Eq , Deserialize , strum:: Display ) ]
165+ #[ strum( serialize_all = "kebab-case" ) ]
166+ #[ serde( rename_all = "kebab-case" ) ]
167+ pub enum ProvisionParts {
168+ /// Provision only public (non-senstive) data.
169+ Public ,
170+
171+ /// Provision both public and private data.
172+ #[ default]
173+ PublicPrivate ,
174+ }
175+
164176/// Internal parameters of [`SecretVolumeSelector`] managed by secret-operator itself.
165177// These are optional even if they are set unconditionally, because otherwise we will
166178// fail to restore volumes (after Node reboots etc) from before they were added during upgrades.
@@ -285,16 +297,6 @@ impl SecretVolumeSelector {
285297 )
286298 } )
287299 }
288-
289- fn deserialize_str_as_bool < ' de , D : Deserializer < ' de > > ( de : D ) -> Result < bool , D :: Error > {
290- let str = String :: deserialize ( de) ?;
291- str. parse ( ) . map_err ( |_| {
292- <D :: Error as serde:: de:: Error >:: invalid_value (
293- Unexpected :: Str ( & str) ,
294- & "a string containing a boolean" ,
295- )
296- } )
297- }
298300}
299301
300302#[ derive( Debug ) ]
0 commit comments