mirror of https://github.com/k3s-io/k3s
Merge pull request #68132 from soltysh/deprecate_run
Automatic merge from submit-queue (batch tested with PRs 63011, 68089, 67944, 68132). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md. Start deprecating all generators in run except for run-pod/v1 **What this PR does / why we need it**: This was discussed during SIG-CLI meetings over several past months. The direction is that we want to move away from `kubectl run` because it's over bloated and complicated for both users and developers. We want to mimic `docker run` with `kubectl run` so that it *only* creates a pod, and if you're interested in other resources `kubectl create` is the intended replacement. This PR starts with deprecating all of the generator except for the pod one. /assign @juanvallejo /sig cli /milestone v1.12 **Release note**: ```release-note Deprecate kubectl run generators, except for run-pod/v1 ```pull/8/head
commit
92ad24cc4d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue