kubectl/pkg/cmd/run: deprecate flags

The --cascade flag, has no practical effect when used, so it is being deprecated.

The following flags, which are unused and ignored by kubectl run,
have been deprecated:

--filename
--force
--grace-period
--kustomize
--recursive
--timeout
--wait

Kubernetes-commit: 09804a198c64f0a738ede28e0b2cb045d16980fc
This commit is contained in:
Brian Pursley 2022-11-03 23:11:12 -04:00 committed by Kubernetes Publisher
parent 6020929e34
commit c6025a8904
1 changed files with 17 additions and 0 deletions

View File

@ -166,6 +166,23 @@ func NewCmdRun(f cmdutil.Factory, streams genericclioptions.IOStreams) *cobra.Co
addRunFlags(cmd, o)
cmdutil.AddApplyAnnotationFlags(cmd)
cmdutil.AddPodRunningTimeoutFlag(cmd, defaultPodAttachTimeout)
// Deprecate the cascade flag. If set, it has no practical effect since the created pod has no dependents.
// TODO: Remove the cascade flag from the run command in kubectl 1.29
cmd.Flags().MarkDeprecated("cascade", "because it is not relevant for this command. It will be removed in version 1.29.")
// Deprecate and hide unused flags.
// These flags are being added to the run command by DeleteFlags to support pod deletion after attach,
// but they are not used if set, so they effectively do nothing.
// TODO: Remove these flags from the run command in kubectl 1.29
cmd.Flags().MarkDeprecated("filename", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("force", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("grace-period", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("kustomize", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("recursive", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("timeout", "because it is not used by this command. It will be removed in version 1.29.")
cmd.Flags().MarkDeprecated("wait", "because it is not used by this command. It will be removed in version 1.29.")
return cmd
}