Skip to content

Commit 4bf11a2

Browse files
[v1.3.x] Bug fix: helm operator uninstall is not properly checking for existing release (#4457)
Co-authored-by: Mike Ng <[email protected]>
1 parent ddcda90 commit 4bf11a2

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
entries:
2+
- description: Fixed a bug that caused the Helm operator to remove the finalizer without doing a helm uninstall.
3+
kind: "bugfix"
4+
breaking: false

internal/helm/release/manager.go

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -351,18 +351,6 @@ func createJSONMergePatch(existingJSON, expectedJSON []byte) ([]byte, error) {
351351

352352
// UninstallRelease performs a Helm release uninstall.
353353
func (m manager) UninstallRelease(ctx context.Context, opts ...UninstallOption) (*rpb.Release, error) {
354-
// Get history of this release
355-
h, err := m.storageBackend.History(m.releaseName)
356-
if err != nil {
357-
return nil, fmt.Errorf("failed to get release history: %w", err)
358-
}
359-
360-
// If there is no history, the release has already been uninstalled,
361-
// so return ErrReleaseNotFound.
362-
if len(h) == 0 {
363-
return nil, driver.ErrReleaseNotFound
364-
}
365-
366354
uninstall := action.NewUninstall(m.actionConfig)
367355
for _, o := range opts {
368356
if err := o(uninstall); err != nil {

0 commit comments

Comments
 (0)