fix karmadactl taint failed

Signed-off-by: wuyingjun <wuyingjun_yewu@cmss.chinamobile.com>
This commit is contained in:
wuyingjun 2022-05-18 16:31:32 +08:00
parent db21fac0f6
commit 44df4a9aca
1 changed files with 6 additions and 0 deletions

View File

@ -115,6 +115,12 @@ func (o *CommandTaintOption) Complete(args []string) error {
}
kubeConfigFlags := genericclioptions.NewConfigFlags(false).WithDeprecatedPasswordFlag()
if o.KubeConfig != "" {
kubeConfigFlags.KubeConfig = &o.KubeConfig
kubeConfigFlags.Context = &o.KarmadaContext
}
matchVersionKubeConfigFlags := cmdutil.NewMatchVersionFlags(kubeConfigFlags)
f := cmdutil.NewFactory(matchVersionKubeConfigFlags)