From 9c8335b65a4527ea3a07687e4a7a8ba5ebd72041 Mon Sep 17 00:00:00 2001 From: BLasan Date: Tue, 13 Apr 2021 23:58:24 +0530 Subject: [PATCH] Remove AddGeneratorFlag function --- .../k8s.io/kubectl/pkg/cmd/create/create_deployment.go | 2 +- staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go index 283e8a528f3..04a3e55a2f2 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/create/create_deployment.go @@ -111,7 +111,7 @@ func NewCmdCreateDeployment(f cmdutil.Factory, ioStreams genericclioptions.IOStr cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddValidateFlags(cmd) - cmdutil.AddGeneratorFlags(cmd, "") + cmdutil.AddDryRunFlag(cmd) cmd.Flags().StringSliceVar(&o.Images, "image", o.Images, "Image names to run.") cmd.MarkFlagRequired("image") cmd.Flags().Int32Var(&o.Port, "port", o.Port, "The port that this container exposes.") diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go b/staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go index 40746f7d098..1d86235402d 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/util/helpers.go @@ -456,14 +456,6 @@ func AddApplyAnnotationVarFlags(cmd *cobra.Command, applyAnnotation *bool) { cmd.Flags().BoolVar(applyAnnotation, ApplyAnnotationsFlag, *applyAnnotation, "If true, the configuration of current object will be saved in its annotation. Otherwise, the annotation will be unchanged. This flag is useful when you want to perform kubectl apply on this object in the future.") } -// AddGeneratorFlags adds flags common to resource generation commands -// TODO: need to take a pass at other generator commands to use this set of flags -func AddGeneratorFlags(cmd *cobra.Command, defaultGenerator string) { - cmd.Flags().String("generator", defaultGenerator, "The name of the API generator to use.") - cmd.Flags().MarkDeprecated("generator", "has no effect and will be removed in the future.") - AddDryRunFlag(cmd) -} - func AddChunkSizeFlag(cmd *cobra.Command, value *int64) { cmd.Flags().Int64Var(value, "chunk-size", *value, "Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.")