Skip to content

Commit c0c928f

Browse files
authored
Remove last_ update_time from ClusterCondition (#1054)
* remove last update time from ClusterCondition * adapted changelog * remove remaining last_update_time references * fix tests * update crd preview * add breaking hint
1 parent 982e07c commit c0c928f

File tree

7 files changed

+13
-19
lines changed

7 files changed

+13
-19
lines changed

crates/stackable-operator/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ All notable changes to this project will be documented in this file.
88

99
- Update `kube` to `1.1.0` ([#1049]).
1010

11+
### Removed
12+
13+
- BREAKING: Removed `last_update_time` from CRD ClusterCondition status ([#1054]).
14+
15+
[#1049]: https://github.com/stackabletech/operator-rs/pull/1049
16+
[#1054]: https://github.com/stackabletech/operator-rs/pull/1054
17+
1118
## [0.93.2] - 2025-05-26
1219

1320
### Added
@@ -20,7 +27,6 @@ All notable changes to this project will be documented in this file.
2027

2128
[#986]: https://github.com/stackabletech/operator-rs/pull/986
2229
[#1023]: https://github.com/stackabletech/operator-rs/pull/1023
23-
[#1049]: https://github.com/stackabletech/operator-rs/pull/1049
2430

2531
## [0.93.1] - 2025-05-20
2632

crates/stackable-operator/crds/DummyCluster.yaml

Lines changed: 0 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/stackable-operator/src/status/condition/daemonset.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ impl DaemonSetConditionBuilder {
6363
status: available,
6464
type_: ClusterConditionType::Available,
6565
last_transition_time: None,
66-
last_update_time: None,
6766
}
6867
}
6968

crates/stackable-operator/src/status/condition/deployment.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ impl DeploymentConditionBuilder {
6464
status: available,
6565
type_: ClusterConditionType::Available,
6666
last_transition_time: None,
67-
last_update_time: None,
6867
}
6968
}
7069

crates/stackable-operator/src/status/condition/mod.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,18 @@ pub struct ClusterCondition {
9393
#[serde(skip_serializing_if = "Option::is_none")]
9494
/// Last time the condition transitioned from one status to another.
9595
pub last_transition_time: Option<Time>,
96-
#[serde(skip_serializing_if = "Option::is_none")]
97-
/// The last time this condition was updated.
98-
pub last_update_time: Option<Time>,
96+
9997
#[serde(skip_serializing_if = "Option::is_none")]
10098
/// A human readable message indicating details about the transition.
10199
pub message: Option<String>,
100+
102101
#[serde(skip_serializing_if = "Option::is_none")]
103102
/// The reason for the condition's last transition.
104103
pub reason: Option<String>,
104+
105105
/// Status of the condition, one of True, False, Unknown.
106106
pub status: ClusterConditionStatus,
107+
107108
/// Type of deployment condition.
108109
#[serde(rename = "type")]
109110
pub type_: ClusterConditionType,
@@ -346,17 +347,15 @@ fn update_timestamps(
346347
assert_eq!(old_condition.type_, new_condition.type_);
347348

348349
let now = Time(Utc::now());
349-
// No change in status -> update "last_update_time" and keep "last_transition_time"
350+
// No change in status -> keep "last_transition_time"
350351
if old_condition.status == new_condition.status {
351352
ClusterCondition {
352-
last_update_time: Some(now),
353353
last_transition_time: old_condition.last_transition_time,
354354
..new_condition
355355
}
356-
// Change in status -> set new "last_update_time" and "last_transition_time"
356+
// Change in status -> set new "last_transition_time"
357357
} else {
358358
ClusterCondition {
359-
last_update_time: Some(now.clone()),
360359
last_transition_time: Some(now),
361360
..new_condition
362361
}
@@ -511,7 +510,6 @@ mod tests {
511510
assert_eq!(got.type_, expected.type_);
512511
assert_eq!(got.status, expected.status);
513512
assert_eq!(got.message, expected.message);
514-
assert_eq!(got.last_transition_time, got.last_update_time);
515513
assert!(got.last_transition_time.is_some());
516514
}
517515

crates/stackable-operator/src/status/condition/operations.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ impl<'a> ClusterOperationsConditionBuilder<'a> {
4949
status,
5050
type_: ClusterConditionType::ReconciliationPaused,
5151
last_transition_time: None,
52-
last_update_time: None,
5352
}
5453
}
5554

@@ -82,7 +81,6 @@ impl<'a> ClusterOperationsConditionBuilder<'a> {
8281
status,
8382
type_: ClusterConditionType::Stopped,
8483
last_transition_time: None,
85-
last_update_time: None,
8684
}
8785
}
8886
}

crates/stackable-operator/src/status/condition/statefulset.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ impl StatefulSetConditionBuilder {
6464
status: available,
6565
type_: ClusterConditionType::Available,
6666
last_transition_time: None,
67-
last_update_time: None,
6867
}
6968
}
7069

0 commit comments

Comments
 (0)