From 52c2335b7168920a8e5618767245deaebfbc510f Mon Sep 17 00:00:00 2001 From: Dong Gang Date: Fri, 24 Jul 2020 16:48:44 +0800 Subject: [PATCH] fix(exit code): fix the return exit code 0 if subcommand excuted failed Close: #8286 Signed-off-by: Dong Gang --- cmd/helm/dependency.go | 1 + cmd/helm/get.go | 1 + cmd/helm/plugin.go | 1 + cmd/helm/repo.go | 1 + cmd/helm/search.go | 1 + cmd/helm/show.go | 1 + 6 files changed, 6 insertions(+) diff --git a/cmd/helm/dependency.go b/cmd/helm/dependency.go index 2cc4c5045..388511360 100644 --- a/cmd/helm/dependency.go +++ b/cmd/helm/dependency.go @@ -89,6 +89,7 @@ func newDependencyCmd(out io.Writer) *cobra.Command { Short: "manage a chart's dependencies", Long: dependencyDesc, Args: require.NoArgs, + Run: func(cmd *cobra.Command, args []string) {}, } cmd.AddCommand(newDependencyListCmd(out)) diff --git a/cmd/helm/get.go b/cmd/helm/get.go index 7c4854b59..3302e95e3 100644 --- a/cmd/helm/get.go +++ b/cmd/helm/get.go @@ -41,6 +41,7 @@ func newGetCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { Short: "download extended information of a named release", Long: getHelp, Args: require.NoArgs, + Run: func(cmd *cobra.Command, args []string) {}, } cmd.AddCommand(newGetAllCmd(cfg, out)) diff --git a/cmd/helm/plugin.go b/cmd/helm/plugin.go index 8e1044f54..5792ef5e5 100644 --- a/cmd/helm/plugin.go +++ b/cmd/helm/plugin.go @@ -35,6 +35,7 @@ func newPluginCmd(out io.Writer) *cobra.Command { Use: "plugin", Short: "install, list, or uninstall Helm plugins", Long: pluginHelp, + Run: func(cmd *cobra.Command, args []string) {}, } cmd.AddCommand( newPluginInstallCmd(out), diff --git a/cmd/helm/repo.go b/cmd/helm/repo.go index ad6ceaa8f..72ee2b445 100644 --- a/cmd/helm/repo.go +++ b/cmd/helm/repo.go @@ -38,6 +38,7 @@ func newRepoCmd(out io.Writer) *cobra.Command { Short: "add, list, remove, update, and index chart repositories", Long: repoHelm, Args: require.NoArgs, + Run: func(cmd *cobra.Command, args []string) {}, } cmd.AddCommand(newRepoAddCmd(out)) diff --git a/cmd/helm/search.go b/cmd/helm/search.go index 240d5e7c7..dd4010574 100644 --- a/cmd/helm/search.go +++ b/cmd/helm/search.go @@ -34,6 +34,7 @@ func newSearchCmd(out io.Writer) *cobra.Command { Use: "search [keyword]", Short: "search for a keyword in charts", Long: searchDesc, + Run: func(cmd *cobra.Command, args []string) {}, } cmd.AddCommand(newSearchHubCmd(out)) diff --git a/cmd/helm/show.go b/cmd/helm/show.go index c122d8476..cfa12238b 100644 --- a/cmd/helm/show.go +++ b/cmd/helm/show.go @@ -60,6 +60,7 @@ func newShowCmd(out io.Writer) *cobra.Command { Aliases: []string{"inspect"}, Long: showDesc, Args: require.NoArgs, + Run: func(cmd *cobra.Command, args []string) {}, } // Function providing dynamic auto-completion