Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#197 from fmount/obs_gen
Browse files Browse the repository at this point in the history
Set ObservedGeneration after condition init
  • Loading branch information
openshift-merge-bot[bot] authored Apr 9, 2024
2 parents 85bf191 + df3bf9a commit 8c09c6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions controllers/swift_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ func (r *SwiftReconciler) Reconcile(ctx context.Context, req ctrl.Request) (resu
)

instance.Status.Conditions.Init(&cl)
// Update the lastObserved generation before evaluating conditions
instance.Status.ObservedGeneration = instance.Generation

// If we're not deleting this and the service object doesn't have our finalizer, add it.
if instance.DeletionTimestamp.IsZero() && controllerutil.AddFinalizer(instance, helper.GetFinalizer()) || isNewInstance {
Expand Down Expand Up @@ -333,8 +335,6 @@ func (r *SwiftReconciler) reconcileNormal(ctx context.Context, instance *swiftv1

r.Log.Info(fmt.Sprintf("Reconciled Service '%s' successfully", instance.Name))

// Update the lastObserved generation before evaluating conditions
instance.Status.ObservedGeneration = instance.Generation
// We reached the end of the Reconcile, update the Ready condition based on
// the sub conditions
if instance.Status.Conditions.AllSubConditionIsTrue() {
Expand Down

0 comments on commit 8c09c6f

Please sign in to comment.