Skip to content

Commit

Permalink
should apply pre-delete hook when the managedCluster is deleting (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Zhiwei Yin <zyin@redhat.com>
  • Loading branch information
zhiweiyin318 authored Mar 10, 2022
1 parent df7ea69 commit 9c08db9
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/addonmanager/controllers/agentdeploy/hookcontroller.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,7 @@ func (c *addonHookDeployController) sync(ctx context.Context, syncCtx factory.Sy
return err
}

if !managedCluster.DeletionTimestamp.IsZero() {
// managed cluster is deleting, remove cache.
c.cache.removeCache(preDeleteHookWorkName(addonName), clusterName)
return nil
}
// should continue to apply pre-delete hook when the managedCluster is deleting.

managedClusterAddon, err := c.managedClusterAddonLister.ManagedClusterAddOns(clusterName).Get(addonName)
if errors.IsNotFound(err) {
Expand Down

0 comments on commit 9c08db9

Please sign in to comment.