Skip to content

Commit 4b5cf0a

Browse files
committed
Remove deprecated kubectl drain flag
delete-local-data was deprecated back in v1.20 with this commit: kubernetes@625e47a It's about time we entirely drop the support for this flag. Users should be already using delete-emptydir-data instead.
1 parent f1917f1 commit 4b5cf0a

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
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,

0 commit comments

Comments
 (0)