Merge pull request #76662 from stuart-mclaren/version-fix

Fix kubectl version --client=true
This commit is contained in:
Kubernetes Prow Robot 2019-04-20 15:39:44 -07:00 committed by GitHub
commit b1fea1bdf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,9 @@ func NewCmdVersion(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *co
// Complete completes all the required options
func (o *Options) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
var err error
if o.ClientOnly {
return nil
}
o.discoveryClient, err = f.ToDiscoveryClient()
// if we had an empty rest.Config, continue and just print out client information.
// if we had an error other than being unable to build a rest.Config, fail.