Start deprecating all generators in run except for run-pod/v1

pull/8/head
Maciej Szulik 2018-08-31 13:56:15 +02:00
parent 5b355f5d40
commit 2c4917db86
No known key found for this signature in database
GPG Key ID: F15E55D276FA84C4
1 changed files with 7 additions and 0 deletions

View File

@ -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 {