From dec9b3b9bf0c850002642848b2c5a12fae1f82a8 Mon Sep 17 00:00:00 2001 From: Cecilia Bernardi Date: Fri, 26 Nov 2021 17:25:56 +0000 Subject: [PATCH] if the status of the last release is 'uninstalled' perform an install --- controllers/helmrelease_controller.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/controllers/helmrelease_controller.go b/controllers/helmrelease_controller.go index 6e2a47ffc..c20ee8402 100644 --- a/controllers/helmrelease_controller.go +++ b/controllers/helmrelease_controller.go @@ -20,6 +20,7 @@ import ( "context" "errors" "fmt" + "helm.sh/helm/v3/pkg/release" "strings" "time" @@ -341,7 +342,7 @@ func (r *HelmReleaseReconciler) reconcileRelease(ctx context.Context, // Deploy the release. var deployAction v2.DeploymentAction - if rel == nil { + if rel == nil || rel.Info.Status == release.StatusUninstalled { r.event(ctx, hr, revision, events.EventSeverityInfo, "Helm install has started") deployAction = hr.Spec.GetInstall() rel, err = run.Install(hr, chart, values)