mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Start deprecating long/golang version information
This commit is contained in:
parent
d58f42961c
commit
43c09f6f9d
@ -86,6 +86,7 @@ func NewCmdVersion(f cmdutil.Factory, ioStreams genericclioptions.IOStreams) *co
|
|||||||
}
|
}
|
||||||
cmd.Flags().BoolVar(&o.ClientOnly, "client", o.ClientOnly, "If true, shows client version only (no server required).")
|
cmd.Flags().BoolVar(&o.ClientOnly, "client", o.ClientOnly, "If true, shows client version only (no server required).")
|
||||||
cmd.Flags().BoolVar(&o.Short, "short", o.Short, "If true, print just the version number.")
|
cmd.Flags().BoolVar(&o.Short, "short", o.Short, "If true, print just the version number.")
|
||||||
|
cmd.Flags().MarkDeprecated("short", "and will be removed in the future. The --short output will become the default.")
|
||||||
cmd.Flags().StringVarP(&o.Output, "output", "o", o.Output, "One of 'yaml' or 'json'.")
|
cmd.Flags().StringVarP(&o.Output, "output", "o", o.Output, "One of 'yaml' or 'json'.")
|
||||||
return cmd
|
return cmd
|
||||||
}
|
}
|
||||||
@ -143,6 +144,7 @@ func (o *Options) Run() error {
|
|||||||
fmt.Fprintf(o.Out, "Server Version: %s\n", versionInfo.ServerVersion.GitVersion)
|
fmt.Fprintf(o.Out, "Server Version: %s\n", versionInfo.ServerVersion.GitVersion)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
fmt.Fprintf(o.ErrOut, "WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.\n")
|
||||||
fmt.Fprintf(o.Out, "Client Version: %#v\n", *versionInfo.ClientVersion)
|
fmt.Fprintf(o.Out, "Client Version: %#v\n", *versionInfo.ClientVersion)
|
||||||
fmt.Fprintf(o.Out, "Kustomize Version: %s\n", versionInfo.KustomizeVersion)
|
fmt.Fprintf(o.Out, "Kustomize Version: %s\n", versionInfo.KustomizeVersion)
|
||||||
if versionInfo.ServerVersion != nil {
|
if versionInfo.ServerVersion != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user