Skip to content

Commit

Permalink
Merge pull request #768 from gibizer/restore-last-transition-time-of-…
Browse files Browse the repository at this point in the history
…ready

Restore lastTransitionTime of ReadyCondition
  • Loading branch information
openshift-merge-bot[bot] authored Apr 22, 2024
2 parents 9052790 + 6f426cf commit 8f652bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion controllers/core/openstackcontrolplane_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr

// 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 @@ -174,6 +173,8 @@ func (r *OpenStackControlPlaneReconciler) Reconcile(ctx context.Context, req ctr
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}

condition.RestoreLastTransitionTimes(&instance.Status.Conditions, savedConditions)

err := helper.PatchInstance(ctx, instance)
if err != nil {
_err = err
Expand Down
5 changes: 3 additions & 2 deletions controllers/core/openstackversion_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req

// 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 @@ -143,6 +141,9 @@ func (r *OpenStackVersionReconciler) Reconcile(ctx context.Context, req ctrl.Req
instance.Status.Conditions.Mirror(condition.ReadyCondition))
}

condition.RestoreLastTransitionTimes(
&instance.Status.Conditions, savedConditions)

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

0 comments on commit 8f652bd

Please sign in to comment.