fix(v3): fix regression on non-zero plugin exist status

Fixes the regression in helm-3.0.0-beta.5 that swallows and rounds any non-zero exit status greater than 1 from a helm plugin to `1`.

This, for example, breaks `helm-diff` which relies on helm able to return `2` when `helm-diff` returned `2`.

Closese #6788

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
pull/6790/head
Yusuke Kuoka 6 years ago
parent 63c6378bf6
commit 3144cf0fed

@ -69,19 +69,19 @@ func main() {
if err := actionConfig.Init(settings, false, os.Getenv("HELM_DRIVER"), debug); err != nil { if err := actionConfig.Init(settings, false, os.Getenv("HELM_DRIVER"), debug); err != nil {
debug("%+v", err) debug("%+v", err)
switch e := err.(type) {
case pluginError:
os.Exit(e.code)
default:
os.Exit(1) os.Exit(1)
} }
}
if err := cmd.Execute(); err != nil { if err := cmd.Execute(); err != nil {
debug("%+v", err) debug("%+v", err)
switch e := err.(type) {
case pluginError:
os.Exit(e.code)
default:
os.Exit(1) os.Exit(1)
} }
} }
}
// wordSepNormalizeFunc changes all flags that contain "_" separators // wordSepNormalizeFunc changes all flags that contain "_" separators
func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { func wordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {

Loading…
Cancel
Save