Skip to content

Commit de4c66c

Browse files
Merge pull request openstack-k8s-operators#178 from gibizer/namespace-delete
[DNSMasq]Check delete before creating ServiceAccount
2 parents 4fef7af + c3054ae commit de4c66c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

controllers/network/dnsmasq_controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,11 @@ func (r *DNSMasqReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
165165
instance.Status.Hash = map[string]string{}
166166
}
167167

168+
// Handle service delete
169+
if !instance.DeletionTimestamp.IsZero() {
170+
return r.reconcileDelete(ctx, instance, helper)
171+
}
172+
168173
// Service account, role, binding
169174
rbacRules := []rbacv1.PolicyRule{
170175
{
@@ -186,11 +191,6 @@ func (r *DNSMasqReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
186191
return rbacResult, nil
187192
}
188193

189-
// Handle service delete
190-
if !instance.DeletionTimestamp.IsZero() {
191-
return r.reconcileDelete(ctx, instance, helper)
192-
}
193-
194194
// Handle non-deleted clusters
195195
return r.reconcileNormal(ctx, instance, helper)
196196
}

0 commit comments

Comments
 (0)