Skip to content

Commit 8eb179f

Browse files
chore: Update changelog
1 parent 5179369 commit 8eb179f

3 files changed

Lines changed: 24 additions & 11 deletions

File tree

crates/stackable-operator/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@ All notable changes to this project will be documented in this file.
88

99
- Add `Client::{get_feature_gates,get_enabled_feature_gates,get_disabled_feature_gates}` associated
1010
functions to retrieve all, enabled, or disabled feature gates from the Kubernetes apiserver ([#1207]).
11+
- Support the annotation `secrets.stackable.tech/backend.autotls.cert.domain-components-in-subject-dn`
12+
in the `SecretOperatorVolumeSourceBuilder` ([#1209]).
1113

1214
### Changed
1315

1416
- BREAKING: Use `serde_json::Value` instead of `String` for user-provided JSON `configOverrides`. This change is marked as breaking, as it causes a breaking change to the CRDs ([#1206]).
1517

1618
[#1206]: https://github.com/stackabletech/operator-rs/pull/1206
1719
[#1207]: https://github.com/stackabletech/operator-rs/pull/1207
20+
[#1209]: https://github.com/stackabletech/operator-rs/pull/1209
1821

1922
## [0.111.1] - 2026-04-28
2023

crates/stackable-operator/src/builder/pod/volume.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,9 @@ impl SecretOperatorVolumeSourceBuilder {
402402
}
403403

404404
if let Some(enabled) = self.auto_tls_cert_domain_components_in_subject_dn {
405-
annotations.insert(
406-
Annotation::auto_tls_cert_domain_components_in_subject_dn(enabled)
407-
.context(ParseAnnotationSnafu)?,
408-
);
405+
annotations.insert(Annotation::auto_tls_cert_domain_components_in_subject_dn(
406+
enabled,
407+
));
409408
}
410409

411410
Ok(EphemeralVolumeSource {

crates/stackable-operator/src/kvp/annotation/mod.rs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -161,21 +161,23 @@ impl Annotation {
161161
pub fn autoscaling_retry(retry: bool) -> Self {
162162
// SAFETY: We use expect here, because the input parameter can only be one of two possible
163163
// values: true or false. This fact in combination with the known annotation key length
164-
// allows use to use expect here, instead of bubbling up the error.
164+
// allows us to use expect here, instead of bubbling up the error.
165165
let kvp = KeyValuePair::try_from(("autoscaling.stackable.tech/retry", retry.to_string()))
166166
.expect("autoscaling retry annotation must be valid");
167167
Self(kvp)
168168
}
169169

170-
/// Constructs a `secrets.stackable.tech/backend.autotls.cert.lifetime` annotation.
171-
pub fn auto_tls_cert_domain_components_in_subject_dn(
172-
enabled: bool,
173-
) -> Result<Self, AnnotationError> {
170+
/// Constructs a `secrets.stackable.tech/backend.autotls.cert.domain-components-in-subject-dn` annotation.
171+
pub fn auto_tls_cert_domain_components_in_subject_dn(enabled: bool) -> Self {
172+
// SAFETY: We use expect here, because the input parameter can only be one of two possible
173+
// values: true or false. This fact in combination with the known annotation key length
174+
// allows us to use expect here, instead of bubbling up the error.
174175
let kvp = KeyValuePair::try_from((
175176
"secrets.stackable.tech/backend.autotls.cert.domain-components-in-subject-dn",
176177
enabled.to_string(),
177-
))?;
178-
Ok(Self(kvp))
178+
))
179+
.expect("annotation must be valid");
180+
Self(kvp)
179181
}
180182
}
181183

@@ -368,4 +370,13 @@ mod test {
368370

369371
assert_eq!(annotations.len(), 2);
370372
}
373+
374+
#[test]
375+
fn test_boolean_annotations() {
376+
// Check that the functions do not fail for all possible inputs
377+
for value in [false, true] {
378+
Annotation::autoscaling_retry(value);
379+
Annotation::auto_tls_cert_domain_components_in_subject_dn(value);
380+
}
381+
}
371382
}

0 commit comments

Comments
 (0)