From f1917f18eb715353610b6dfa0744698fa3fa7654 Mon Sep 17 00:00:00 2001 From: Maciej Szulik Date: Wed, 26 Jun 2024 17:42:13 +0200 Subject: [PATCH] Remove deprecated kubectl run flags This commits removes the following flags from kubectl run: - filename - force - grace-period - kustomize - recursive - timeout - wait Those flags are deprecated since v1.26, see this commit https://github.com/kubernetes/kubernetes/commit/09804a198c64f0a738ede28e0b2cb045d16980fc. --- staging/src/k8s.io/kubectl/pkg/cmd/run/run.go | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go b/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go index 1819b384bb5..75e9846c3db 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go @@ -167,22 +167,6 @@ func NewCmdRun(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Com 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 }