Skip to content

Commit

Permalink
Merge pull request #73 from SovereignCloudStack/fix-csr-delete
Browse files Browse the repository at this point in the history
🐛 Fix delete of csr if assets cannot be downloaded
  • Loading branch information
janiskemper committed May 28, 2024
2 parents 5b4364f + 2d2af96 commit 31e5a3d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions internal/controller/clusterstackrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ func (r *ClusterStackReleaseReconciler) Reconcile(ctx context.Context, req recon
defer func() {
conditions.SetSummary(clusterStackRelease)

// Check if the object has a deletion timestamp and release assets have not been downloaded properly.
// In that case, the controller cannot perform a proper reconcileDelete and we just remove the finalizer.
if !clusterStackRelease.DeletionTimestamp.IsZero() &&
conditions.IsFalse(clusterStackRelease, csov1alpha1.ClusterStackReleaseAssetsReadyCondition) {
controllerutil.RemoveFinalizer(clusterStackRelease, csov1alpha1.ClusterStackReleaseFinalizer)
}

if err := patchHelper.Patch(ctx, clusterStackRelease); err != nil {
reterr = fmt.Errorf("failed to patch ClusterStackRelease: %w", err)
}
Expand Down

0 comments on commit 31e5a3d

Please sign in to comment.