From f7faaa7970798081c26e82d171beef3b6d1ebff4 Mon Sep 17 00:00:00 2001 From: Timofey Kirillov Date: Fri, 10 Jun 2022 19:03:34 +0300 Subject: [PATCH] fix(helm): fix 'werf helm *' commands to correctly initialize namespace; 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 https://github.com/werf/werf/issues/4524 Signed-off-by: Timofey Kirillov --- cmd/werf/helm/helm.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmd/werf/helm/helm.go b/cmd/werf/helm/helm.go index 4bea310be5..1cade142d0 100644 --- a/cmd/werf/helm/helm.go +++ b/cmd/werf/helm/helm.go @@ -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() @@ -207,6 +208,9 @@ func NewCmd() *cobra.Command { } } + cmd.PersistentFlags().ParseErrorsWhitelist.UnknownFlags = true + cmd.PersistentFlags().Parse(os.Args[1:]) + return cmd }