diff --git a/pkg/actions/cluster/owned.go b/pkg/actions/cluster/owned.go index e91ef2de01..8cb85dad43 100644 --- a/pkg/actions/cluster/owned.go +++ b/pkg/actions/cluster/owned.go @@ -120,6 +120,9 @@ func (c *OwnedCluster) Delete(ctx context.Context, _, podEvictionWaitPeriod time } newTasksToDeleteAddonIAM := addon.NewRemover(c.stackManager).DeleteAddonIAMTasks newTasksToDeletePodIdentityRoles := func() (*tasks.TaskTree, error) { + if !clusterOperable { + return &tasks.TaskTree{}, nil + } clientSet, err = c.newClientSet() if err != nil { if force { diff --git a/pkg/cfn/manager/delete_tasks.go b/pkg/cfn/manager/delete_tasks.go index 512ab03c77..d2770457d8 100644 --- a/pkg/cfn/manager/delete_tasks.go +++ b/pkg/cfn/manager/delete_tasks.go @@ -30,7 +30,7 @@ type NewOIDCManager func() (*iamoidc.OpenIDConnectManager, error) // NewTasksToDeleteAddonIAM temporary type, to be removed after moving NewTasksToDeleteClusterWithNodeGroups to actions package type NewTasksToDeleteAddonIAM func(ctx context.Context, wait bool) (*tasks.TaskTree, error) -// NewTasksToDeletePodIdentityRoles temporary type, to be removed after moving NewTasksToDeleteClusterWithNodeGroups to actions package +// NewTasksToDeletePodIdentityRole temporary type, to be removed after moving NewTasksToDeleteClusterWithNodeGroups to actions package type NewTasksToDeletePodIdentityRole func() (*tasks.TaskTree, error) // NewTasksToDeleteClusterWithNodeGroups defines tasks required to delete the given cluster along with all of its resources