Skip to content

Commit b1fea1b

Browse files
authored
Merge pull request kubernetes#76662 from stuart-mclaren/version-fix
Fix kubectl version --client=true
2 parents c0c1e14 + d4ee919 commit b1fea1b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/kubectl/cmd/version/version.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ func NewCmdVersion(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *co
8888
// Complete completes all the required options
8989
func (o *Options) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
9090
var err error
91+
if o.ClientOnly {
92+
return nil
93+
}
9194
o.discoveryClient, err = f.ToDiscoveryClient()
9295
// if we had an empty rest.Config, continue and just print out client information.
9396
// if we had an error other than being unable to build a rest.Config, fail.

0 commit comments

Comments
 (0)