From f79d07eb722ea0893e8baf4d39095137b81c921d 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 Kubernetes-commit: 6caa3b5c77fdb72f7c0421eda71339f590b6c95e --- pkg/cmd/run/run.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cmd/run/run.go b/pkg/cmd/run/run.go index 000529a06..d5498453a 100644 --- a/pkg/cmd/run/run.go +++ b/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)