Skip to content

Commit

Permalink
Merge pull request #979 from rabi/transtion_time
Browse files Browse the repository at this point in the history
Restore LastTransitionTime after setting Ready Condition
  • Loading branch information
openshift-merge-bot[bot] authored Jul 26, 2024
2 parents 0ffab07 + e0e36f3 commit f712796
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,6 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,

// Always patch the instance status when exiting this function so we can persist any changes.
defer func() { // update the Ready condition based on the sub conditions
condition.RestoreLastTransitionTimes(
&instance.Status.Conditions, savedConditions)
if instance.Status.Conditions.AllSubConditionIsTrue() {
instance.Status.Conditions.MarkTrue(
condition.ReadyCondition, condition.ReadyMessage)
Expand All @@ -137,6 +135,8 @@ func (r *OpenStackDataPlaneDeploymentReconciler) Reconcile(ctx context.Context,
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}

condition.RestoreLastTransitionTimes(
&instance.Status.Conditions, savedConditions)
err := helper.PatchInstance(ctx, instance)
if err != nil {
Log.Error(err, "Error updating instance status conditions")
Expand Down
4 changes: 2 additions & 2 deletions controllers/dataplane/openstackdataplanenodeset_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,6 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req

// Always patch the instance status when exiting this function so we can persist any changes.
defer func() { // update the Ready condition based on the sub conditions
condition.RestoreLastTransitionTimes(
&instance.Status.Conditions, savedConditions)
if instance.Status.Conditions.AllSubConditionIsTrue() {
instance.Status.Conditions.MarkTrue(
condition.ReadyCondition, dataplanev1.NodeSetReadyMessage)
Expand All @@ -186,6 +184,8 @@ func (r *OpenStackDataPlaneNodeSetReconciler) Reconcile(ctx context.Context, req
instance.Status.Conditions.Set(
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}
condition.RestoreLastTransitionTimes(
&instance.Status.Conditions, savedConditions)

err := helper.PatchInstance(ctx, instance)
if err != nil {
Expand Down

0 comments on commit f712796

Please sign in to comment.