From 888119a47cd8f023373025e9998de3d20038fc7c Mon Sep 17 00:00:00 2001 From: QuaSoft Date: Tue, 24 Jul 2018 11:59:37 +0300 Subject: [PATCH 1/2] Mark exec --pod/-p flag as deprecated --- pkg/kubectl/cmd/exec.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kubectl/cmd/exec.go b/pkg/kubectl/cmd/exec.go index 5290b0fd22c..adaedfb5811 100644 --- a/pkg/kubectl/cmd/exec.go +++ b/pkg/kubectl/cmd/exec.go @@ -85,6 +85,7 @@ func NewCmdExec(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.C }, } cmd.Flags().StringVarP(&options.PodName, "pod", "p", options.PodName, "Pod name") + cmd.Flags().MarkDeprecated("pod", "This flag is deprecated and will be removed in future. Use exec POD_NAME instead.") // TODO support UID cmd.Flags().StringVarP(&options.ContainerName, "container", "c", options.ContainerName, "Container name. If omitted, the first container in the pod will be chosen") cmd.Flags().BoolVarP(&options.Stdin, "stdin", "i", options.Stdin, "Pass stdin to the container") From 75804c35aac3b96473b8faaab930678d04c602a8 Mon Sep 17 00:00:00 2001 From: QuaSoft Date: Tue, 24 Jul 2018 15:59:44 +0300 Subject: [PATCH 2/2] Remove warning for deprecated flag usage as pflag already does that --- pkg/kubectl/cmd/exec.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/kubectl/cmd/exec.go b/pkg/kubectl/cmd/exec.go index adaedfb5811..16e8f92ed11 100644 --- a/pkg/kubectl/cmd/exec.go +++ b/pkg/kubectl/cmd/exec.go @@ -154,7 +154,6 @@ func (p *ExecOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, argsIn []s return cmdutil.UsageErrorf(cmd, execUsageStr) } if len(p.PodName) != 0 { - printDeprecationWarning(p.ErrOut, "exec POD_NAME", "-p POD_NAME") if len(argsIn) < 1 { return cmdutil.UsageErrorf(cmd, execUsageStr) }