deprecate openapi printing in kubectl in favor of server-side printing

pull/8/head
Jordan Liggitt 2018-06-28 19:41:05 -04:00
parent 613b302b98
commit 5cea147cd3
No known key found for this signature in database
GPG Key ID: 39928704103C7229
1 changed files with 6 additions and 0 deletions

View File

@ -304,6 +304,11 @@ func (o *GetOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e
return o.watch(f, cmd, args)
}
// openapi printing is mutually exclusive with server side printing
if o.PrintWithOpenAPICols && o.ServerPrint {
fmt.Fprintf(o.IOStreams.ErrOut, "warning: --%s requested, --%s will be ignored\n", useOpenAPIPrintColumnFlagLabel, useServerPrintColumns)
}
r := f.NewBuilder().
Unstructured().
NamespaceParam(o.Namespace).DefaultNamespace().AllNamespaces(o.AllNamespaces).
@ -716,6 +721,7 @@ func (o *GetOptions) printGeneric(r *resource.Result) error {
func addOpenAPIPrintColumnFlags(cmd *cobra.Command, opt *GetOptions) {
cmd.Flags().BoolVar(&opt.PrintWithOpenAPICols, useOpenAPIPrintColumnFlagLabel, opt.PrintWithOpenAPICols, "If true, use x-kubernetes-print-column metadata (if present) from the OpenAPI schema for displaying a resource.")
cmd.Flags().MarkDeprecated(useOpenAPIPrintColumnFlagLabel, "deprecated in favor of server-side printing")
}
func addServerPrintColumnFlags(cmd *cobra.Command, opt *GetOptions) {