@@ -92,6 +92,7 @@ use crate::{
9292 merge:: Merge ,
9393 } ,
9494 product_config_utils:: Configuration ,
95+ time:: Duration ,
9596 utils:: crds:: raw_object_schema,
9697} ;
9798use derivative:: Derivative ;
@@ -144,6 +145,23 @@ pub struct CommonConfiguration<T> {
144145 #[ serde( default ) ]
145146 #[ schemars( schema_with = "raw_object_schema" ) ]
146147 pub pod_overrides : PodTemplateSpec ,
148+
149+ /// The minimum lifetime of secrets generated by the secret operator.
150+ /// Some secrets, such as self signed certificates are constrained to a maximum lifetime by the
151+ /// [SecretClass](DOCS_BASE_URL_PLACEHOLDER/secret-operator/secretclass) object it's self.
152+ /// Currently this property covers self signed certificates but in the future it may be extended to other
153+ /// secret types such as Kerberos keytabs.
154+ #[ serde( default ) ]
155+ pub min_secret_lifetime : Duration ,
156+ }
157+
158+ /// This implementation targets the `CommonConfiguration::min_secret_lifetime` specifically
159+ /// and corresponds to the current TLS certificate lifetime that the secret operator issues by
160+ /// default.
161+ impl Default for Duration {
162+ fn default ( ) -> Self {
163+ Duration :: from_hours_unchecked ( 24 )
164+ }
147165}
148166
149167fn config_schema_default ( ) -> serde_json:: Value {
@@ -203,6 +221,7 @@ where
203221 env_overrides : self . config . env_overrides ,
204222 cli_overrides : self . config . cli_overrides ,
205223 pod_overrides : self . config . pod_overrides ,
224+ min_secret_lifetime : self . config . min_secret_lifetime ,
206225 } ,
207226 role_config : self . role_config ,
208227 role_groups : self
@@ -219,6 +238,7 @@ where
219238 env_overrides : group. config . env_overrides ,
220239 cli_overrides : group. config . cli_overrides ,
221240 pod_overrides : group. config . pod_overrides ,
241+ min_secret_lifetime : group. config . min_secret_lifetime ,
222242 } ,
223243 replicas : group. replicas ,
224244 } ,
0 commit comments