You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ApplyAggregatesAndUpdateStatus for uniform status handling
Three controllers were calling ApplyAggregates, but only one
was maintaining the status. Unify that, so we always an accurate
reflection on the aggregates there.
Expect(meta.FindStatusCondition(hypervisor.Status.Conditions, kvmv1.ConditionTypeAggregatesUpdated)).NotTo(BeNil(), "AggregatesUpdated condition should exist before applying aggregates")
150
+
151
+
By("Calling ApplyAggregatesAndUpdateStatus to remove from all aggregates")
Expect(hypervisor.Status.Aggregates).To(BeEmpty(), "Status.Aggregates should be cleared")
158
+
159
+
By("Verifying the AggregatesUpdated condition was removed")
160
+
Expect(meta.FindStatusCondition(hypervisor.Status.Conditions, kvmv1.ConditionTypeAggregatesUpdated)).To(BeNil(), "AggregatesUpdated condition should be removed")
Expect(meta.FindStatusCondition(hypervisor.Status.Conditions, kvmv1.ConditionTypeAggregatesUpdated)).NotTo(BeNil(), "AggregatesUpdated condition should exist before applying aggregates")
190
+
191
+
By("Calling ApplyAggregatesAndUpdateStatus which will fail")
Expect(err).To(HaveOccurred(), "ApplyAggregatesAndUpdateStatus should return an error")
195
+
196
+
By("Verifying the AggregatesUpdated condition was still removed despite the error")
197
+
Expect(meta.FindStatusCondition(hypervisor.Status.Conditions, kvmv1.ConditionTypeAggregatesUpdated)).To(BeNil(), "AggregatesUpdated condition should be removed even on failure, leaving it in unknown state")
0 commit comments