From 0a38b2804d9b665627bc1bf899d711ba4adfa1b0 Mon Sep 17 00:00:00 2001 From: yuzhiquan Date: Tue, 8 Jun 2021 10:49:23 +0800 Subject: [PATCH] add deprecated message for igonre-errors flag, and fix unsafety http link --- staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go b/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go index c2a13a078e8..0d00e9ae9cd 100644 --- a/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go +++ b/staging/src/k8s.io/kubectl/pkg/cmd/drain/drain.go @@ -112,7 +112,7 @@ var ( The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the APIServer supports - [eviction](http://kubernetes.io/docs/admin/disruptions/). Otherwise, it will use normal + [eviction](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/). Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are DaemonSet-managed pods, drain will not proceed @@ -130,7 +130,7 @@ var ( When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again. - ![Workflow](http://kubernetes.io/images/docs/kubectl_drain.svg)`)) + ![Workflow](https://kubernetes.io/images/docs/kubectl_drain.svg)`)) drainExample = templates.Examples(i18n.T(` # Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it. @@ -310,6 +310,9 @@ func (o *DrainCmdOptions) RunDrain() error { fmt.Fprintf(o.ErrOut, "error: unable to drain node %q due to error:%s, continuing command...\n", info.Name, err) continue } + fmt.Fprintf(o.ErrOut, "DEPRECATED WARNING: Aborting the drain command in a list of nodes will be deprecated in v1.23.\n"+ + "The new behavior will make the drain command go through all nodes even if one or more nodes failed during the drain.\n"+ + "For now, users can try such experience via: --ignore-errors\n") fmt.Fprintf(o.ErrOut, "error: unable to drain node %q, aborting command...\n\n", info.Name) remainingNodes := []string{} fatal = err