mirror of
https://github.com/helmfile/helmfile.git
synced 2026-09-30 16:52:40 +02:00
fix: helmfile delete should not stop on uninstalled release(s) (#509)
Resolves #481
This commit is contained in:
+8
-1
@@ -708,7 +708,14 @@ func (st *HelmState) DeleteReleases(helm helmexec.Interface, purge bool) []error
|
||||
if purge {
|
||||
flags = append(flags, "--purge")
|
||||
}
|
||||
return helm.DeleteRelease(release.Name, flags...)
|
||||
installed, err := isReleaseInstalled(helm, release)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if installed {
|
||||
return helm.DeleteRelease(release.Name, flags...)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -80,6 +80,9 @@ info "Deleting release"
|
||||
${helmfile} -f ${dir}/happypath.yaml delete
|
||||
${helm} status --namespace=${test_ns} httpbin &> /dev/null && fail "release should not exist anymore after a delete"
|
||||
|
||||
info "Ensuring \"helmfile delete\" doesn't fail when no releases installed"
|
||||
${helmfile} -f ${dir}/happypath.yaml delete || fail "\"helmfile delete\" shouldn't fail when there are no installed releases"
|
||||
|
||||
test_pass "happypath"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user