diff --git a/pkg/controller/main-controller.go b/pkg/controller/main-controller.go index 431e5d0c842..aeb4e1c3d50 100644 --- a/pkg/controller/main-controller.go +++ b/pkg/controller/main-controller.go @@ -804,6 +804,12 @@ func (c *Controller) syncHandler(key string) (Result, error) { // will retry after 5sec return WrapResult(Result{RequeueAfter: time.Second * 5}, nil) } + // Check if the Tenant is marked to be deleted + // Shouldn't create resources when marked for deletion + if !tenant.DeletionTimestamp.IsZero() { + runtime.HandleError(fmt.Errorf("Tenant '%s' is marked for deletion, skipping", key)) + return WrapResult(Result{}, nil) + } // Check the Sync Version to see if the tenant needs upgrade if tenant, err = c.checkForUpgrades(ctx, tenant); err != nil {