Skip to content

Commit

Permalink
fix(helm): fix 'werf helm *' commands to correctly initialize namespa…
Browse files Browse the repository at this point in the history
…ce; fix output

* Initialize global 'werf helm *' flags early, the same way as original helm does.
* Fix 'werf helm PLUGIN' not uses --namespace param.
* Fix 'werf helm *' commands not to print help on command failure.

Fixes #4524

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
  • Loading branch information
distorhead committed Jun 10, 2022
1 parent e785c87 commit f7faaa7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd/werf/helm/helm.go
Expand Up @@ -41,8 +41,9 @@ func NewCmd() *cobra.Command {
actionConfig := new(action.Configuration)

cmd := &cobra.Command{
Use: "helm",
Short: "Manage application deployment with helm",
Use: "helm",
Short: "Manage application deployment with helm",
SilenceUsage: true,
}

ctx := common.GetContext()
Expand Down Expand Up @@ -207,6 +208,9 @@ func NewCmd() *cobra.Command {
}
}

cmd.PersistentFlags().ParseErrorsWhitelist.UnknownFlags = true
cmd.PersistentFlags().Parse(os.Args[1:])

return cmd
}

Expand Down

0 comments on commit f7faaa7

Please sign in to comment.