Skip to content

Commit e02ac76

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 d9ccf24 commit e02ac76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/cmd/agent/controller/bundledeployment_controller.go

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

237+
// Uninstall the release to allow a new reconcile loop to re-install it,
238+
// resolving the missing resource(s) issue.
239+
if err := r.Cleanup.CleanupReleases(ctx, key, nil); err != nil {
240+
logger.V(1).Info("Failed to clean up releases before triggering new deployment", "error", err)
241+
}
242+
237243
return ctrl.Result{RequeueAfter: durations.DefaultRequeueAfter}, nil
238244
}
239245
}

0 commit comments

Comments
 (0)