Skip to content

Commit 1d649ce

Browse files
authored
Merge branch 'main' into docs/crd-versioning-macro-order
2 parents 0ddd4c0 + 17054c3 commit 1d649ce

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ All notable changes to this project will be documented in this file.
1212
### Changed
1313

1414
- BREAKING: `validation` module now uses typed errors ([#851]).
15+
- Set `checkIncrement` to 5 seconds in Logback config ([#853]).
1516

1617
### Fixed
1718

1819
- Fix the CRD description of `ClientAuthenticationDetails` to not contain internal Rust doc, but a public CRD description ([#846]).
1920
- `StackableAffinity` fields are no longer erroneously marked as required ([#855]).
21+
- BREAKING: `ClusterResources` will now only consider deleting objects that are marked as directly owned (via `.metadata.ownerReferences`) ([#862]).
2022

2123
[#846]: https://github.com/stackabletech/operator-rs/pull/846
2224
[#851]: https://github.com/stackabletech/operator-rs/pull/851
25+
[#853]: https://github.com/stackabletech/operator-rs/pull/853
2326
[#855]: https://github.com/stackabletech/operator-rs/pull/855
2427
[#858]: https://github.com/stackabletech/operator-rs/pull/858
28+
[#862]: https://github.com/stackabletech/operator-rs/pull/862
2529

2630
## [0.74.0] - 2024-08-22
2731

crates/stackable-operator/src/cluster_resources.rs

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,9 @@ pub struct ClusterResources {
388388
/// The name of the application
389389
app_name: String,
390390

391+
/// The uid of the cluster object
392+
cluster_uid: String,
393+
391394
// TODO (Techassi): Add doc comments
392395
operator_name: String,
393396

@@ -434,17 +437,22 @@ impl ClusterResources {
434437
) -> Result<Self> {
435438
let namespace = cluster
436439
.namespace
437-
.to_owned()
440+
.clone()
438441
.context(MissingObjectKeySnafu { key: "namespace" })?;
439442
let app_instance = cluster
440443
.name
441-
.to_owned()
444+
.clone()
442445
.context(MissingObjectKeySnafu { key: "name" })?;
446+
let cluster_uid = cluster
447+
.uid
448+
.clone()
449+
.context(MissingObjectKeySnafu { key: "uid" })?;
443450

444451
Ok(ClusterResources {
445452
namespace,
446453
app_instance,
447454
app_name: app_name.into(),
455+
cluster_uid,
448456
operator_name: operator_name.into(),
449457
controller_name: controller_name.into(),
450458
manager: format_full_controller_name(operator_name, controller_name),
@@ -741,10 +749,22 @@ impl ClusterResources {
741749
..Default::default()
742750
};
743751

744-
let resources = client
752+
let mut resources = client
745753
.list_with_label_selector::<T>(&self.namespace, &label_selector)
746754
.await?;
747755

756+
// filter out objects without a direct ownership relationship, for example:
757+
// - indirect ownership where the labels are still propagated
758+
// - objects owned by versions of the cluster recreated before/after the current snapshot
759+
resources.retain(|resource| {
760+
resource
761+
.meta()
762+
.owner_references
763+
.iter()
764+
.flatten()
765+
.any(|reference| reference.uid == self.cluster_uid)
766+
});
767+
748768
Ok(resources)
749769
}
750770
}

crates/stackable-operator/src/product_logging/framework.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,7 @@ pub fn create_logback_config(
589589
</rollingPolicy>
590590
<triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
591591
<MaxFileSize>{max_log_file_size_in_mib}MB</MaxFileSize>
592+
<checkIncrement>5 seconds</checkIncrement>
592593
</triggeringPolicy>
593594
</appender>
594595

0 commit comments

Comments
 (0)