Skip to content

Commit d1d580e

Browse files
Merge pull request #7024 from muraee/fix-OCPBUGS-62949
OCPBUGS-62949: fix(resources): prevent indefinite blocking on cloud resource cleanup during deletion
2 parents 3911b92 + cea31d3 commit d1d580e

File tree

7 files changed

+790
-32
lines changed

7 files changed

+790
-32
lines changed

api/hypershift/v1beta1/hostedcluster_conditions.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ const (
249249
KubeVirtNodesLiveMigratableReason = "KubeVirtNodesNotLiveMigratable"
250250

251251
RecoveryFinishedReason = "RecoveryFinished"
252+
253+
CloudResourcesCleanupSkippedReason = "CloudResourcesCleanupSkipped"
252254
)
253255

254256
// Messages.

control-plane-operator/controllers/hostedcontrolplane/hostedcontrolplane_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,6 +2796,13 @@ func (r *HostedControlPlaneReconciler) removeCloudResources(ctx context.Context,
27962796
return true, nil
27972797
}
27982798

2799+
// check if cleanup has been skipped
2800+
if resourcesDestroyedCond != nil && resourcesDestroyedCond.Status == metav1.ConditionFalse &&
2801+
resourcesDestroyedCond.Reason == string(hyperv1.CloudResourcesCleanupSkippedReason) {
2802+
log.Info("Cleanup has been skipped", "reason", resourcesDestroyedCond.Message)
2803+
return true, nil
2804+
}
2805+
27992806
// if CVO has been scaled down, we're waiting for resources to be destroyed
28002807
cvoScaledDownCond := meta.FindStatusCondition(hcp.Status.Conditions, string(hyperv1.CVOScaledDown))
28012808
if cvoScaledDownCond != nil && cvoScaledDownCond.Status == metav1.ConditionTrue {

0 commit comments

Comments
 (0)