Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#333 from openshift-cherryp…
Browse files Browse the repository at this point in the history
…ick-robot/cherry-pick-332-to-18.0.0-proposed

[18.0.0-proposed] Restore LastTransitionTime after setting Ready Condition
  • Loading branch information
openshift-merge-bot[bot] authored Jul 29, 2024
2 parents 8f7cb45 + 7add4dc commit bf82e63
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/ovncontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ func (r *OVNControllerReconciler) Reconcile(ctx context.Context, req ctrl.Reques

// Always patch the instance status when exiting this function so we can persist any changes.
defer func() {
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
// update the Ready condition based on the sub conditions
if instance.Status.Conditions.AllSubConditionIsTrue() {
instance.Status.Conditions.MarkTrue(
Expand All @@ -149,6 +148,7 @@ func (r *OVNControllerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
instance.Status.Conditions.Set(
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
err := helper.PatchInstance(ctx, instance)
if err != nil {
_err = err
Expand Down
2 changes: 1 addition & 1 deletion controllers/ovndbcluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ func (r *OVNDBClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request

// Always patch the instance status when exiting this function so we can persist any changes.
defer func() {
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
// update the Ready condition based on the sub conditions
if instance.Status.Conditions.AllSubConditionIsTrue() {
instance.Status.Conditions.MarkTrue(
Expand All @@ -182,6 +181,7 @@ func (r *OVNDBClusterReconciler) Reconcile(ctx context.Context, req ctrl.Request
instance.Status.Conditions.Set(
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
err := helper.PatchInstance(ctx, instance)
if err != nil {
_err = err
Expand Down
2 changes: 1 addition & 1 deletion controllers/ovnnorthd_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func (r *OVNNorthdReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

// Always patch the instance status when exiting this function so we can persist any changes.
defer func() {
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
// update the Ready condition based on the sub conditions
if instance.Status.Conditions.AllSubConditionIsTrue() {
instance.Status.Conditions.MarkTrue(
Expand All @@ -158,6 +157,7 @@ func (r *OVNNorthdReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
instance.Status.Conditions.Set(
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}
condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)
err := helper.PatchInstance(ctx, instance)
if err != nil {
_err = err
Expand Down

0 comments on commit bf82e63

Please sign in to comment.