Merge pull request #102677 from yuzhiquan/deprecated-warning-for-drain

Deprecated message for ignore-errors flag

Kubernetes-commit: 99f77725c88d1d9c0b7ac29c65d1595d9ded8169
This commit is contained in:
Kubernetes Publisher 2021-07-06 22:11:03 -07:00
commit a8d330c2e8
3 changed files with 9 additions and 6 deletions

4
go.mod
View File

@ -34,7 +34,7 @@ require (
k8s.io/api v0.0.0-20210707054401-2c49f10e0b15
k8s.io/apimachinery v0.0.0-20210701054147-830375057167
k8s.io/cli-runtime v0.0.0-20210706175927-064ccf28ed41
k8s.io/client-go v0.0.0-20210706214629-68cb2ddef93f
k8s.io/client-go v0.0.0-20210707054637-4339f1ba5ffa
k8s.io/component-base v0.0.0-20210702054709-fddd92849e34
k8s.io/component-helpers v0.0.0-20210701055214-c69fdc006e3d
k8s.io/klog/v2 v2.9.0
@ -50,7 +50,7 @@ replace (
k8s.io/api => k8s.io/api v0.0.0-20210707054401-2c49f10e0b15
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210701054147-830375057167
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20210706175927-064ccf28ed41
k8s.io/client-go => k8s.io/client-go v0.0.0-20210706214629-68cb2ddef93f
k8s.io/client-go => k8s.io/client-go v0.0.0-20210707054637-4339f1ba5ffa
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20210704214018-b1b4942f7194
k8s.io/component-base => k8s.io/component-base v0.0.0-20210702054709-fddd92849e34
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20210701055214-c69fdc006e3d

4
go.sum
View File

@ -744,8 +744,8 @@ k8s.io/apimachinery v0.0.0-20210701054147-830375057167 h1:fob/j8+uMBIVvyo+9bG7Gv
k8s.io/apimachinery v0.0.0-20210701054147-830375057167/go.mod h1:O3oNtNadZdeOMxHFVxOreoznohCpy0z6mocxbZr7oJ0=
k8s.io/cli-runtime v0.0.0-20210706175927-064ccf28ed41 h1:0me3gLmsHF+cyQ6tSqfhTkeLNhRyZXEskfdBS+r5C1w=
k8s.io/cli-runtime v0.0.0-20210706175927-064ccf28ed41/go.mod h1:YX5Kh1Kiu00ltxu67hahuxvcU23P/CQ0q1994L4hx4c=
k8s.io/client-go v0.0.0-20210706214629-68cb2ddef93f h1:seULy+bqIY8G2Q98h/e3WaQdkgNIIQUqy8MSUP2TReY=
k8s.io/client-go v0.0.0-20210706214629-68cb2ddef93f/go.mod h1:sbkKCOXetW3FaqcSYCG3ghdfOCSOKTGwitXlliklRrc=
k8s.io/client-go v0.0.0-20210707054637-4339f1ba5ffa h1:ObYOXp2aWP8IzRccMfUUQO3lPYPIJ/7HbutYpcVf73I=
k8s.io/client-go v0.0.0-20210707054637-4339f1ba5ffa/go.mod h1:juFh2Iyc7xJjgMkt2H6xKiId/dxgSyryhfRfYmbAPv8=
k8s.io/code-generator v0.0.0-20210704214018-b1b4942f7194/go.mod h1:eV77Y09IopzeXOJzndrDyCI88UBok2h6WxAlBwpxa+o=
k8s.io/component-base v0.0.0-20210702054709-fddd92849e34 h1:L7kJX0+rX5SJ2ZUaFy8zarcUMW0+2AHkd3gyuIp0ZLM=
k8s.io/component-base v0.0.0-20210702054709-fddd92849e34/go.mod h1:KuldLgSPMxWtcVmPn3hcUoWNJqm7HEdVcSID+ZdAB24=

View File

@ -115,7 +115,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
@ -133,7 +133,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.
@ -314,6 +314,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