From fe00c9296d50acc490dd08cd95eb014d37409716 Mon Sep 17 00:00:00 2001 From: Mayank Thakur Date: Tue, 12 Apr 2022 12:51:30 +0530 Subject: [PATCH] Fixed helm uninstall not deleting the resource. * Added `nil` check for returned err. * Return in case of `err` when deleting the release Signed-off-by: Mayank Thakur --- pkg/action/uninstall.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/action/uninstall.go b/pkg/action/uninstall.go index 65993df4c..9dcbf19b0 100644 --- a/pkg/action/uninstall.go +++ b/pkg/action/uninstall.go @@ -113,6 +113,10 @@ func (u *Uninstall) Run(name string) (*release.UninstallReleaseResponse, error) } deletedResources, kept, errs := u.deleteRelease(rel) + if errs != nil { + u.cfg.Log("uninstall: Failed to delete release: %s", errs) + return nil, errors.Errorf("failed to delete release: %s", name) + } if kept != "" { kept = "These resources were kept due to the resource policy:\n" + kept