Skip to content

Commit

Permalink
fix: do not create resources for marked deleted tenant (#2310)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Sep 11, 2024
1 parent 6785830 commit 59dd68e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controller/main-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 59dd68e

Please sign in to comment.