use discovery client from factory in explain v2

was making my own which was uncached
This commit is contained in:
Alexander Zielenski 2022-11-03 18:59:09 -07:00
parent a82015b4a2
commit dca025f37c

View File

@ -128,11 +128,11 @@ func (o *ExplainOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []
// Only openapi v3 needs the discovery client.
if o.EnableOpenAPIV3 {
clientset, err := f.KubernetesClientSet()
discoveryClient, err := f.ToDiscoveryClient()
if err != nil {
return err
}
o.DiscoveryClient = clientset.DiscoveryClient
o.DiscoveryClient = discoveryClient
}
o.args = args