Skip to content

Commit 31e5a3d

Browse files
authored
Merge pull request #73 from SovereignCloudStack/fix-csr-delete
🐛 Fix delete of csr if assets cannot be downloaded
2 parents 5b4364f + 2d2af96 commit 31e5a3d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/controller/clusterstackrelease_controller.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,13 @@ func (r *ClusterStackReleaseReconciler) Reconcile(ctx context.Context, req recon
8989
defer func() {
9090
conditions.SetSummary(clusterStackRelease)
9191

92+
// Check if the object has a deletion timestamp and release assets have not been downloaded properly.
93+
// In that case, the controller cannot perform a proper reconcileDelete and we just remove the finalizer.
94+
if !clusterStackRelease.DeletionTimestamp.IsZero() &&
95+
conditions.IsFalse(clusterStackRelease, csov1alpha1.ClusterStackReleaseAssetsReadyCondition) {
96+
controllerutil.RemoveFinalizer(clusterStackRelease, csov1alpha1.ClusterStackReleaseFinalizer)
97+
}
98+
9299
if err := patchHelper.Patch(ctx, clusterStackRelease); err != nil {
93100
reterr = fmt.Errorf("failed to patch ClusterStackRelease: %w", err)
94101
}

0 commit comments

Comments
 (0)