Merge pull request #1426 from zgfh/fix-kubectl-karmada-log
fix bug: fix can not use '-v 6' to set log level when run kubectl-karmada
This commit is contained in:
commit
0ef339011d
|
@ -7,8 +7,10 @@ import (
|
|||
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
apiserverflag "k8s.io/component-base/cli/flag"
|
||||
"k8s.io/klog/v2"
|
||||
|
||||
"github.com/karmada-io/karmada/pkg/karmadactl/cmdinit"
|
||||
"github.com/karmada-io/karmada/pkg/version/sharedcommand"
|
||||
|
@ -30,6 +32,9 @@ func NewKarmadaCtlCommand(out io.Writer, cmdUse, parentCommand string) *cobra.Co
|
|||
RunE: runHelp,
|
||||
}
|
||||
|
||||
// Init log flags
|
||||
klog.InitFlags(flag.CommandLine)
|
||||
|
||||
// Add the command line flags from other dependencies (e.g., klog), but do not
|
||||
// warn if they contain underscores.
|
||||
pflag.CommandLine.SetNormalizeFunc(apiserverflag.WordSepNormalizeFunc)
|
||||
|
|
Loading…
Reference in New Issue