From 6caa3b5c77fdb72f7c0421eda71339f590b6c95e Mon Sep 17 00:00:00 2001 From: suknna Date: Wed, 29 Apr 2026 18:35:55 +0800 Subject: [PATCH] kubectl: deprecate run filename flag kubectl run registers --filename and -f through DeleteFlags, but the run command does not consume FilenameOptions. Mark both the long flag and shorthand as deprecated. Signed-off-by: suknna --- staging/src/k8s.io/kubectl/pkg/cmd/run/run.go | 3 +++ 1 file changed, 3 insertions(+) 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 000529a064c..d5498453a8f 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/run/run.go @@ -178,6 +178,9 @@ func NewCmdRun(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Com o.PrintFlags.AddFlags(cmd) o.RecordFlags.AddFlags(cmd) + _ = cmd.Flags().MarkDeprecated("filename", "it is ignored by kubectl run and will be removed in a future release") + _ = cmd.Flags().MarkShorthandDeprecated("filename", "it is ignored by kubectl run and will be removed in a future release") + addRunFlags(cmd, o) cmdutil.AddApplyAnnotationFlags(cmd) cmdutil.AddPodRunningTimeoutFlag(cmd, defaultPodAttachTimeout)