From d4f6b28425f801c0fe8a1d5818c28e47514f6f93 Mon Sep 17 00:00:00 2001 From: Tim Ramlot <42113979+inteon@users.noreply.github.com> Date: Thu, 25 Jan 2024 12:28:40 +0100 Subject: [PATCH] BREAKNIG: remove the default flag value for --v Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com> --- cmd/cmd.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index 2e9a18b..a6c2203 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -22,7 +22,6 @@ import ( "io" "github.com/spf13/cobra" - "github.com/spf13/pflag" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/component-base/logs" @@ -51,23 +50,7 @@ func NewCertManagerCtlCommand(ctx context.Context, in io.Reader, out, err io.Wri } cmds.SetUsageTemplate(usageTemplate()) - { - var logFlags pflag.FlagSet - logf.AddFlagsNonDeprecated(logOptions, &logFlags) - - logFlags.VisitAll(func(f *pflag.Flag) { - switch f.Name { - case "v": - // "cmctl check api" already had a "v" flag that did not require any value, for - // backwards compatibility we allow the "v" logging flag to be set without a value - // and default to "2" (which will result in the same behaviour as before). - f.NoOptDefVal = "2" - cmds.PersistentFlags().AddFlag(f) - default: - cmds.PersistentFlags().AddFlag(f) - } - }) - } + logf.AddFlagsNonDeprecated(logOptions, cmds.PersistentFlags()) ioStreams := genericclioptions.IOStreams{In: in, Out: out, ErrOut: err} for _, registerCmd := range commands.Commands() {