diff --git a/pkg/kubectl/cmd/annotate.go b/pkg/kubectl/cmd/annotate.go index 8e4adaefd79..2ea9c5b395f 100644 --- a/pkg/kubectl/cmd/annotate.go +++ b/pkg/kubectl/cmd/annotate.go @@ -142,7 +142,6 @@ func NewCmdAnnotate(f cmdutil.Factory, out io.Writer) *cobra.Command { usage := "identifying the resource to update the annotation" cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) cmdutil.AddDryRunFlag(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/apply.go b/pkg/kubectl/cmd/apply.go index f38179c664b..fdf52e4fc49 100644 --- a/pkg/kubectl/cmd/apply.go +++ b/pkg/kubectl/cmd/apply.go @@ -164,7 +164,6 @@ func NewCmdApply(baseName string, f cmdutil.Factory, out, errOut io.Writer) *cob cmd.Flags().BoolVar(&options.OpenApiPatch, "openapi-patch", options.OpenApiPatch, "If true, use openapi to calculate diff when the openapi presents and the resource can be found in the openapi spec. Otherwise, fall back to use baked-in types.") cmdutil.AddDryRunFlag(cmd) cmdutil.AddPrinterFlags(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) cmdutil.AddIncludeUninitializedFlag(cmd) // apply subcommands diff --git a/pkg/kubectl/cmd/autoscale.go b/pkg/kubectl/cmd/autoscale.go index 344fc8d89ed..c516f0503a2 100644 --- a/pkg/kubectl/cmd/autoscale.go +++ b/pkg/kubectl/cmd/autoscale.go @@ -95,7 +95,6 @@ func NewCmdAutoscale(f cmdutil.Factory, out io.Writer) *cobra.Command { usage := "identifying the resource to autoscale." cmdutil.AddFilenameOptionFlags(cmd, &o.FilenameOptions, usage) cmdutil.AddApplyAnnotationFlags(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/clusterinfo.go b/pkg/kubectl/cmd/clusterinfo.go index 2e2b7a8b959..0c2da5dc454 100644 --- a/pkg/kubectl/cmd/clusterinfo.go +++ b/pkg/kubectl/cmd/clusterinfo.go @@ -54,7 +54,6 @@ func NewCmdClusterInfo(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.CheckErr(err) }, } - cmdutil.AddInclude3rdPartyFlags(cmd) cmd.AddCommand(NewCmdClusterInfoDump(f, out)) return cmd } diff --git a/pkg/kubectl/cmd/convert.go b/pkg/kubectl/cmd/convert.go index bb93a8f9cc1..634a9916783 100644 --- a/pkg/kubectl/cmd/convert.go +++ b/pkg/kubectl/cmd/convert.go @@ -85,7 +85,6 @@ func NewCmdConvert(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddNonDeprecatedPrinterFlags(cmd) cmd.Flags().BoolVar(&options.local, "local", options.local, "If true, convert will NOT try to contact api-server but run locally.") cmd.Flags().String("output-version", "", i18n.T("Output the formatted object with the given group version (for ex: 'extensions/v1beta1').)")) - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/create/create.go b/pkg/kubectl/cmd/create/create.go index b696096931d..3d8a0b87050 100644 --- a/pkg/kubectl/cmd/create/create.go +++ b/pkg/kubectl/cmd/create/create.go @@ -117,7 +117,6 @@ func NewCmdCreate(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { "Only relevant if --edit=true. Defaults to the line ending native to your platform.") cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddDryRunFlag(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) cmd.Flags().StringVarP(&o.Selector, "selector", "l", o.Selector, "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)") cmd.Flags().StringVar(&o.Raw, "raw", o.Raw, "Raw URI to POST to the server. Uses the transport specified by the kubeconfig file.") @@ -300,7 +299,6 @@ func RunEditOnCreate(f cmdutil.Factory, recordFlags *genericclioptions.RecordFla editOptions.Output = cmdutil.GetFlagString(cmd, "output") editOptions.ApplyAnnotation = cmdutil.GetFlagBool(cmd, cmdutil.ApplyAnnotationsFlag) editOptions.RecordFlags = recordFlags - editOptions.Include3rdParty = cmdutil.GetFlagBool(cmd, "include-extended-apis") err := editOptions.Complete(f, []string{}, cmd) if err != nil { diff --git a/pkg/kubectl/cmd/create/create_secret.go b/pkg/kubectl/cmd/create/create_secret.go index c9b6d6f4982..7e7ed51f73b 100644 --- a/pkg/kubectl/cmd/create/create_secret.go +++ b/pkg/kubectl/cmd/create/create_secret.go @@ -200,7 +200,6 @@ func NewCmdCreateSecretDockerRegistry(f cmdutil.Factory, cmdOut io.Writer) *cobr cmd.Flags().Bool("append-hash", false, "Append a hash of the secret to its name.") cmd.Flags().StringSlice("from-file", []string{}, "Key files can be specified using their file path, in which case a default name will be given to them, or optionally with a name and file path, in which case the given name will be used. Specifying a directory will iterate each named file in the directory that is a valid secret key.") - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/create/create_serviceaccount.go b/pkg/kubectl/cmd/create/create_serviceaccount.go index 9a445a19c48..4ac7b97d29f 100644 --- a/pkg/kubectl/cmd/create/create_serviceaccount.go +++ b/pkg/kubectl/cmd/create/create_serviceaccount.go @@ -66,7 +66,6 @@ func NewCmdCreateServiceAccount(f cmdutil.Factory, cmdOut io.Writer) *cobra.Comm cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddValidateFlags(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) cmdutil.AddGeneratorFlags(cmd, cmdutil.ServiceAccountV1GeneratorName) return cmd } diff --git a/pkg/kubectl/cmd/delete.go b/pkg/kubectl/cmd/delete.go index fd0184a9ece..ed14f31fbab 100644 --- a/pkg/kubectl/cmd/delete.go +++ b/pkg/kubectl/cmd/delete.go @@ -103,8 +103,7 @@ type DeleteOptions struct { GracePeriod int Timeout time.Duration - Include3rdParty bool - Output string + Output string Mapper meta.RESTMapper Result *resource.Result diff --git a/pkg/kubectl/cmd/delete_flags.go b/pkg/kubectl/cmd/delete_flags.go index 8bf00a0dae8..e611c6174dd 100644 --- a/pkg/kubectl/cmd/delete_flags.go +++ b/pkg/kubectl/cmd/delete_flags.go @@ -68,8 +68,6 @@ type DeleteFlags struct { Now *bool Timeout *time.Duration Output *string - - IncludeThirdParty *bool } func (f *DeleteFlags) ToOptions(out, errOut io.Writer) *DeleteOptions { @@ -110,10 +108,6 @@ func (f *DeleteFlags) ToOptions(out, errOut io.Writer) *DeleteOptions { options.Timeout = *f.Timeout } - if f.IncludeThirdParty != nil { - options.Include3rdParty = *f.IncludeThirdParty - } - return options } @@ -146,16 +140,10 @@ func (f *DeleteFlags) AddFlags(cmd *cobra.Command) { cmd.Flags().StringVarP(f.Output, "output", "o", *f.Output, "Output mode. Use \"-o name\" for shorter output (resource/name).") } - // TODO: this is deprecated. Remove. - if f.IncludeThirdParty != nil { - cmd.Flags().BoolVar(f.IncludeThirdParty, "include-extended-apis", *f.IncludeThirdParty, "If true, include definitions of new APIs via calls to the API server. [default true]") - cmd.Flags().MarkDeprecated("include-extended-apis", "No longer required.") - } } // NewDeleteCommandFlags provides default flags and values for use with the "delete" command func NewDeleteCommandFlags(usage string) *DeleteFlags { - includeThirdParty := true cascade := true gracePeriod := -1 @@ -182,14 +170,11 @@ func NewDeleteCommandFlags(usage string) *DeleteFlags { Now: &now, Timeout: &timeout, Output: &output, - - IncludeThirdParty: &includeThirdParty, } } // NewDeleteFlags provides default flags and values for use in commands outside of "delete" func NewDeleteFlags(usage string) *DeleteFlags { - includeThirdParty := true cascade := true gracePeriod := -1 @@ -205,8 +190,6 @@ func NewDeleteFlags(usage string) *DeleteFlags { Cascade: &cascade, GracePeriod: &gracePeriod, - IncludeThirdParty: &includeThirdParty, - // add non-defaults Force: &force, Timeout: &timeout, diff --git a/pkg/kubectl/cmd/describe.go b/pkg/kubectl/cmd/describe.go index 8f106bcf96d..0ff28a2ac28 100644 --- a/pkg/kubectl/cmd/describe.go +++ b/pkg/kubectl/cmd/describe.go @@ -98,7 +98,6 @@ func NewCmdDescribe(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command { cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)") cmd.Flags().Bool("all-namespaces", false, "If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.") cmd.Flags().BoolVar(&describerSettings.ShowEvents, "show-events", describerSettings.ShowEvents, "If true, display events related to the described object.") - cmdutil.AddInclude3rdPartyFlags(cmd) cmdutil.AddIncludeUninitializedFlag(cmd) return cmd } diff --git a/pkg/kubectl/cmd/edit.go b/pkg/kubectl/cmd/edit.go index c321a0e4ed1..f2915d9a0f0 100644 --- a/pkg/kubectl/cmd/edit.go +++ b/pkg/kubectl/cmd/edit.go @@ -71,7 +71,6 @@ var ( func NewCmdEdit(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { o := editor.NewEditOptions(editor.NormalEditMode, out, errOut) o.ValidateOptions = cmdutil.ValidateOptions{EnableValidation: true} - o.Include3rdParty = true validArgs := cmdutil.ValidArgList(f) @@ -105,7 +104,6 @@ func NewCmdEdit(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { "Defaults to the line ending native to your platform.") cmdutil.AddApplyAnnotationVarFlags(cmd, &o.ApplyAnnotation) - cmdutil.AddInclude3rdPartyVarFlags(cmd, &o.Include3rdParty) cmdutil.AddIncludeUninitializedFlag(cmd) return cmd } diff --git a/pkg/kubectl/cmd/explain.go b/pkg/kubectl/cmd/explain.go index c0dda66d266..d391988e5d2 100644 --- a/pkg/kubectl/cmd/explain.go +++ b/pkg/kubectl/cmd/explain.go @@ -64,7 +64,6 @@ func NewCmdExplain(f cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command { } cmd.Flags().Bool("recursive", false, "Print the fields of fields (Currently only 1 level deep)") cmd.Flags().String("api-version", "", "Get different explanations for particular API version") - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/label.go b/pkg/kubectl/cmd/label.go index f1368e014c3..3d2de88d490 100644 --- a/pkg/kubectl/cmd/label.go +++ b/pkg/kubectl/cmd/label.go @@ -132,7 +132,6 @@ func NewCmdLabel(f cmdutil.Factory, out, errout io.Writer) *cobra.Command { cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) cmdutil.AddDryRunFlag(cmd) cmdutil.AddRecordFlag(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) cmdutil.AddIncludeUninitializedFlag(cmd) return cmd diff --git a/pkg/kubectl/cmd/logs.go b/pkg/kubectl/cmd/logs.go index d4cc79ca446..e65f3a1442b 100644 --- a/pkg/kubectl/cmd/logs.go +++ b/pkg/kubectl/cmd/logs.go @@ -122,7 +122,6 @@ func NewCmdLogs(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { cmd.Flags().StringP("container", "c", "", "Print the logs of this container") cmd.Flags().Bool("interactive", false, "If true, prompt the user for input when required.") cmd.Flags().MarkDeprecated("interactive", "This flag is no longer respected and there is no replacement.") - cmdutil.AddInclude3rdPartyFlags(cmd) cmdutil.AddPodRunningTimeoutFlag(cmd, defaultPodLogsTimeout) cmd.Flags().StringP("selector", "l", "", "Selector (label query) to filter on.") return cmd diff --git a/pkg/kubectl/cmd/patch.go b/pkg/kubectl/cmd/patch.go index 0612048824a..89c59824e5e 100644 --- a/pkg/kubectl/cmd/patch.go +++ b/pkg/kubectl/cmd/patch.go @@ -104,7 +104,6 @@ func NewCmdPatch(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddPrinterFlags(cmd) cmdutil.AddRecordFlag(cmd) cmdutil.AddDryRunFlag(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) usage := "identifying the resource to update" cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, usage) diff --git a/pkg/kubectl/cmd/resource/get.go b/pkg/kubectl/cmd/resource/get.go index 8810e919ff3..b57dec77ed3 100644 --- a/pkg/kubectl/cmd/resource/get.go +++ b/pkg/kubectl/cmd/resource/get.go @@ -172,7 +172,6 @@ func NewCmdGet(f cmdutil.Factory, out io.Writer, errOut io.Writer) *cobra.Comman cmd.Flags().StringSliceVarP(&options.LabelColumns, "label-columns", "L", options.LabelColumns, "Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2...") cmd.Flags().BoolVar(&options.Export, "export", options.Export, "If true, use 'export' for the resources. Exported resources are stripped of cluster-specific information.") cmdutil.AddFilenameOptionFlags(cmd, &options.FilenameOptions, "identifying the resource to get from a server.") - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/rollingupdate.go b/pkg/kubectl/cmd/rollingupdate.go index 5e0873b175f..833b1eeae98 100644 --- a/pkg/kubectl/cmd/rollingupdate.go +++ b/pkg/kubectl/cmd/rollingupdate.go @@ -102,7 +102,6 @@ func NewCmdRollingUpdate(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddDryRunFlag(cmd) cmdutil.AddValidateFlags(cmd) cmdutil.AddPrinterFlags(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) return cmd } diff --git a/pkg/kubectl/cmd/run_test.go b/pkg/kubectl/cmd/run_test.go index e7e8f24b062..94ede79de7f 100644 --- a/pkg/kubectl/cmd/run_test.go +++ b/pkg/kubectl/cmd/run_test.go @@ -393,7 +393,6 @@ func TestGenerateService(t *testing.T) { cmd := &cobra.Command{} cmd.Flags().Bool(cmdutil.ApplyAnnotationsFlag, false, "") cmd.Flags().Bool("record", false, "Record current kubectl command in the resource annotation. If set to false, do not record the command. If set to true, record the command. If not set, default to updating the existing annotation value only if one already exists.") - cmdutil.AddInclude3rdPartyFlags(cmd) addRunFlags(cmd) if !test.expectPOST { diff --git a/pkg/kubectl/cmd/scale.go b/pkg/kubectl/cmd/scale.go index c8cd0dcf343..43e049e2a33 100644 --- a/pkg/kubectl/cmd/scale.go +++ b/pkg/kubectl/cmd/scale.go @@ -89,7 +89,6 @@ func NewCmdScale(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command { cmd.Flags().Duration("timeout", 0, "The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).") cmdutil.AddOutputFlagsForMutation(cmd) cmdutil.AddRecordFlag(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) usage := "identifying the resource to set a new size" cmdutil.AddFilenameOptionFlags(cmd, options, usage) diff --git a/pkg/kubectl/cmd/taint.go b/pkg/kubectl/cmd/taint.go index e48d301d9e2..72e8dde1a9c 100644 --- a/pkg/kubectl/cmd/taint.go +++ b/pkg/kubectl/cmd/taint.go @@ -107,7 +107,6 @@ func NewCmdTaint(f cmdutil.Factory, out io.Writer) *cobra.Command { cmdutil.AddValidateFlags(cmd) cmdutil.AddPrinterFlags(cmd) - cmdutil.AddInclude3rdPartyFlags(cmd) cmd.Flags().StringVarP(&options.selector, "selector", "l", options.selector, "Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)") cmd.Flags().BoolVar(&options.overwrite, "overwrite", options.overwrite, "If true, allow taints to be overwritten, otherwise reject taint updates that overwrite existing taints.") cmd.Flags().BoolVar(&options.all, "all", options.all, "Select all nodes in the cluster") diff --git a/pkg/kubectl/cmd/util/editor/editoptions.go b/pkg/kubectl/cmd/util/editor/editoptions.go index 435ae6b01af..b5b34b2ede8 100644 --- a/pkg/kubectl/cmd/util/editor/editoptions.go +++ b/pkg/kubectl/cmd/util/editor/editoptions.go @@ -71,7 +71,6 @@ type EditOptions struct { CmdNamespace string ApplyAnnotation bool ChangeCause string - Include3rdParty bool Out io.Writer ErrOut io.Writer diff --git a/pkg/kubectl/cmd/util/helpers.go b/pkg/kubectl/cmd/util/helpers.go index a176e9e4c7f..e9b03be4c41 100644 --- a/pkg/kubectl/cmd/util/helpers.go +++ b/pkg/kubectl/cmd/util/helpers.go @@ -593,16 +593,6 @@ func ShouldRecord(cmd *cobra.Command, info *resource.Info) bool { return GetRecordFlag(cmd) || (ContainsChangeCause(info) && !cmd.Flags().Changed("record")) } -func AddInclude3rdPartyFlags(cmd *cobra.Command) { - cmd.Flags().Bool("include-extended-apis", true, "If true, include definitions of new APIs via calls to the API server. [default true]") - cmd.Flags().MarkDeprecated("include-extended-apis", "No longer required.") -} - -func AddInclude3rdPartyVarFlags(cmd *cobra.Command, include3rdParty *bool) { - cmd.Flags().BoolVar(include3rdParty, "include-extended-apis", *include3rdParty, "If true, include definitions of new APIs via calls to the API server. [default true]") - cmd.Flags().MarkDeprecated("include-extended-apis", "No longer required.") -} - // GetResourcesAndPairs retrieves resources and "KEY=VALUE or KEY-" pair args from given args func GetResourcesAndPairs(args []string, pairType string) (resources []string, pairArgs []string, err error) { foundPair := false