Fix reset force which hangs Tiller pod removed

Closes #5592

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
pull/5596/head
Martin Hickey 6 years ago
parent bbae86e09a
commit 77185d31a9

@ -21,6 +21,7 @@ import (
"fmt" "fmt"
"io" "io"
"os" "os"
"strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
@ -59,7 +60,11 @@ func newResetCmd(client helm.Interface, out io.Writer) *cobra.Command {
Short: "uninstalls Tiller from a cluster", Short: "uninstalls Tiller from a cluster",
Long: resetDesc, Long: resetDesc,
PreRunE: func(cmd *cobra.Command, args []string) error { PreRunE: func(cmd *cobra.Command, args []string) error {
if err := setupConnection(); !d.force && err != nil { err := setupConnection()
if !d.force && err != nil {
return err
}
if d.force && err != nil && strings.EqualFold(err.Error(), "could not find tiller") {
return err return err
} }
return nil return nil

Loading…
Cancel
Save