Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#331 from dprince/observed_…
Browse files Browse the repository at this point in the history
…generation_fix

Set ObservedGeneration after condition init
  • Loading branch information
openshift-merge-bot[bot] authored Apr 9, 2024
2 parents 1bd728a + e6fbda8 commit b626799
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions controllers/neutronapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ func (r *NeutronAPIReconciler) Reconcile(ctx context.Context, req ctrl.Request)
)

instance.Status.Conditions.Init(&cl)
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 @@ -1045,8 +1046,6 @@ func (r *NeutronAPIReconciler) reconcileNormal(ctx context.Context, instance *ne
return ctrl.Result{}, err
}
}
// 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 b626799

Please sign in to comment.