Skip to content

Commit 0e2a429

Browse files
committed
Delete Helm release before triggering new deployment
In order to enable the agent to redeploy a bundle deployment with missing, overlapped resources, the corresponding Helm release must be deleted first, so that a new reconcile loop runs the deploy operation.
1 parent aa139cc commit 0e2a429

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

internal/cmd/agent/controller/bundledeployment_controller.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,12 @@ func (r *BundleDeploymentReconciler) Reconcile(ctx context.Context, req ctrl.Req
222222
"namespace", ow.Namespace,
223223
)
224224

225+
// Uninstall the release to allow a new reconcile loop to re-install it,
226+
// resolving the missing resource(s) issue.
227+
if err := r.Cleanup.CleanupReleases(ctx, key, nil); err != nil {
228+
logger.V(1).Info("Failed to clean up releases before triggering new deployment", "error", err)
229+
}
230+
225231
return ctrl.Result{RequeueAfter: durations.DefaultRequeueAfter}, nil
226232
}
227233
}

0 commit comments

Comments
 (0)