Skip to content

Commit

Permalink
rename delete when paused check
Browse files Browse the repository at this point in the history
  • Loading branch information
tatlat committed Feb 22, 2024
1 parent 1f1b4d2 commit 26297e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion controllers/cluster_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ func (r *ClusterReconciler) reconcileDelete(ctx context.Context, log logr.Logger
return ctrl.Result{}, errors.New("deleting self-managed clusters is not supported")
}

if cluster.IsReconcilePaused() && !cluster.IsOkayToDeleteWhenPaused() {
if cluster.IsReconcilePaused() && !cluster.CanDeleteWhenPaused() {
log.Info("Cluster reconciliation is paused, won't process cluster deletion")
return ctrl.Result{}, nil
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/v1alpha1/cluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -1546,8 +1546,8 @@ func (c *Cluster) IsManagedByCLI() bool {
return ok && val == "true"
}

// IsManagedByCLI returns true if the cluster has the allow-delete-when-paused annotation.
func (c *Cluster) IsOkayToDeleteWhenPaused() bool {
// CanDeleteWhenPaused returns true if the cluster has the allow-delete-when-paused annotation.
func (c *Cluster) CanDeleteWhenPaused() bool {
if len(c.Annotations) == 0 {
return false
}
Expand Down

0 comments on commit 26297e7

Please sign in to comment.