can not parse cli args
mstrYoda opened this issue · comments
Emre Savcı commented
For example when I pass --kubeconfig it can not processed by plugin
Batuhan Apaydın commented
@Dentrax, I think we are parsing the kubeconfig correctly but in this code, we are sending the wrong arguments to the function, we must send CLI args to the function instead of OS arguments:
func (o *ViewWebhookOptions) Run() error {
p := printer.NewPrinter(o.Out)
// create the ClientSet from restConfig
clientSet, err := kubernetes.NewForConfig(o.restConfig)
if err != nil {
return err
}
//validatingWebhookClient := clientset.AdmissionregistrationV1beta1().ValidatingWebhookConfigurations()
mw := k8s.NewWebHookClient(clientSet)
model, err := mw.Run(os.Args) --> this step , must be o.Args not os.Args
if err != nil {
return err
}
p.Print(model)
return nil
}
Batuhan Apaydın commented
This bug fixed at v0.0.23, thanks @mstrYoda 👍