From 2c4917db86d8df7a21ba2cc86d0a0635396cb29b Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Fri, 31 Aug 2018 13:56:15 +0200 Subject: [PATCH] Start deprecating all generators in run except for run-pod/v1 --- pkg/kubectl/cmd/run.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/kubectl/cmd/run.go b/pkg/kubectl/cmd/run.go index 6d241809ed..111ef6363d 100644 --- a/pkg/kubectl/cmd/run.go +++ b/pkg/kubectl/cmd/run.go @@ -323,6 +323,13 @@ func (o *RunOptions) Run(f cmdutil.Factory, cmd *cobra.Command, args []string) e } } + // start deprecating all generators except for 'run-pod/v1' which will be + // the only supported on a route to simple kubectl run which should mimic + // docker run + if generatorName != cmdutil.RunPodV1GeneratorName { + fmt.Fprintf(o.ErrOut, "kubectl run --generator=%s is DEPRECATED and will be removed in a future version. Use kubectl create instead.\n", generatorName) + } + generators := cmdutil.GeneratorFn("run") generator, found := generators[generatorName] if !found {