Skip to content

Commit

Permalink
Merge pull request #109 from fuweid/ignore-error-on-delete
Browse files Browse the repository at this point in the history
helmcli: ignore not found error on delete
  • Loading branch information
fuweid authored Mar 31, 2024
2 parents 4626cbf + 0defd0f commit 308b6d3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions helmcli/delete.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package helmcli

import (
"errors"
"fmt"

"helm.sh/helm/v3/pkg/action"
"helm.sh/helm/v3/pkg/storage/driver"
"k8s.io/cli-runtime/pkg/genericclioptions"
)

Expand Down Expand Up @@ -37,5 +39,8 @@ func NewDeleteCli(kubeconfigPath string, namespace string) (*DeleteCli, error) {
func (cli *DeleteCli) Delete(releaseName string) error {
delCli := action.NewUninstall(cli.cfg)
_, err := delCli.Run(releaseName)
if errors.Is(err, driver.ErrReleaseNotFound) {
err = nil
}
return err
}

0 comments on commit 308b6d3

Please sign in to comment.