Skip to content

Commit edecb6c

Browse files
committed
Fix OpenStack CR condition initialization
1 parent b419ca7 commit edecb6c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/operator/openstack_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ func (r *OpenStackReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
189189
}
190190
}()
191191

192-
// If we're not deleting this and the object doesn't have our finalizer, add it.
193-
if instance.DeletionTimestamp.IsZero() && controllerutil.AddFinalizer(instance, openstackHelper.GetFinalizer()) || isNewInstance {
194-
return ctrl.Result{}, err
195-
}
196-
197192
cl := condition.CreateList(
198193
condition.UnknownCondition(operatorv1beta1.OpenStackOperatorReadyCondition, condition.InitReason, string(operatorv1beta1.OpenStackOperatorReadyInitMessage)),
199194
)
@@ -206,6 +201,11 @@ func (r *OpenStackReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
206201
condition.SeverityInfo,
207202
operatorv1beta1.OpenStackOperatorReadyRunningMessage))
208203

204+
// If we're not deleting this and the object doesn't have our finalizer, add it.
205+
if instance.DeletionTimestamp.IsZero() && controllerutil.AddFinalizer(instance, openstackHelper.GetFinalizer()) || isNewInstance {
206+
return ctrl.Result{}, err
207+
}
208+
209209
// We only want one instance of OpenStack. Ignore anything after that.
210210
if len(instanceList.Items) > 0 {
211211
if len(instanceList.Items) > 1 {

0 commit comments

Comments
 (0)