Skip to content

Commit 8ebfb8c

Browse files
authored
Merge pull request kubernetes#125842 from soltysh/remove_deprecated_flags
Remove deprecated kubectl run and drain flags
2 parents 88313a4 + 4b5cf0a commit 8ebfb8c

File tree

3 files changed

+0
-29
lines changed

3 files changed

+0
-29
lines changed

staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,8 +224,6 @@ func NewCmdDrain(f cmdutil.Factory, ioStreams genericiooptions.IOStreams) *cobra
224224
}
225225
cmd.Flags().BoolVar(&o.drainer.Force, "force", o.drainer.Force, "Continue even if there are pods that do not declare a controller.")
226226
cmd.Flags().BoolVar(&o.drainer.IgnoreAllDaemonSets, "ignore-daemonsets", o.drainer.IgnoreAllDaemonSets, "Ignore DaemonSet-managed pods.")
227-
cmd.Flags().BoolVar(&o.drainer.DeleteEmptyDirData, "delete-local-data", o.drainer.DeleteEmptyDirData, "Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).")
228-
cmd.Flags().MarkDeprecated("delete-local-data", "This option is deprecated and will be deleted. Use --delete-emptydir-data.")
229227
cmd.Flags().BoolVar(&o.drainer.DeleteEmptyDirData, "delete-emptydir-data", o.drainer.DeleteEmptyDirData, "Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained).")
230228
cmd.Flags().IntVar(&o.drainer.GracePeriodSeconds, "grace-period", o.drainer.GracePeriodSeconds, "Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used.")
231229
cmd.Flags().DurationVar(&o.drainer.Timeout, "timeout", o.drainer.Timeout, "The length of time to wait before giving up, zero means infinite")

staging/src/k8s.io/kubectl/pkg/cmd/drain/drain_test.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -635,17 +635,6 @@ func TestDrain(t *testing.T) {
635635
expectDelete: true,
636636
expectOutputToContain: "node/node drained",
637637
},
638-
{
639-
description: "Ensure compatibility for --delete-local-data until fully deprecated",
640-
node: node,
641-
expected: cordonedNode,
642-
pods: []corev1.Pod{jobPod},
643-
rcs: []corev1.ReplicationController{rc},
644-
args: []string{"node", "--force", "--delete-local-data=true"},
645-
expectFatal: false,
646-
expectDelete: true,
647-
expectOutputToContain: "node/node drained",
648-
},
649638
{
650639
description: "Job-managed terminated pod",
651640
node: node,

staging/src/k8s.io/kubectl/pkg/cmd/run/run.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -167,22 +167,6 @@ func NewCmdRun(f cmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Com
167167
cmdutil.AddApplyAnnotationFlags(cmd)
168168
cmdutil.AddPodRunningTimeoutFlag(cmd, defaultPodAttachTimeout)
169169

170-
// Deprecate the cascade flag. If set, it has no practical effect since the created pod has no dependents.
171-
// TODO: Remove the cascade flag from the run command in kubectl 1.29
172-
cmd.Flags().MarkDeprecated("cascade", "because it is not relevant for this command. It will be removed in version 1.29.")
173-
174-
// Deprecate and hide unused flags.
175-
// These flags are being added to the run command by DeleteFlags to support pod deletion after attach,
176-
// but they are not used if set, so they effectively do nothing.
177-
// TODO: Remove these flags from the run command in kubectl 1.29
178-
cmd.Flags().MarkDeprecated("filename", "because it is not used by this command. It will be removed in version 1.29.")
179-
cmd.Flags().MarkDeprecated("force", "because it is not used by this command. It will be removed in version 1.29.")
180-
cmd.Flags().MarkDeprecated("grace-period", "because it is not used by this command. It will be removed in version 1.29.")
181-
cmd.Flags().MarkDeprecated("kustomize", "because it is not used by this command. It will be removed in version 1.29.")
182-
cmd.Flags().MarkDeprecated("recursive", "because it is not used by this command. It will be removed in version 1.29.")
183-
cmd.Flags().MarkDeprecated("timeout", "because it is not used by this command. It will be removed in version 1.29.")
184-
cmd.Flags().MarkDeprecated("wait", "because it is not used by this command. It will be removed in version 1.29.")
185-
186170
return cmd
187171
}
188172

0 commit comments

Comments
 (0)