fix kubectl drain ignore daemonsets and others
Kubernetes-commit: e3c8add683a095f1bffef1b0ca413f1e42be7fe0
This commit is contained in:
parent
78b5839d26
commit
94b91c1d51
|
@ -867,7 +867,7 @@ func TestDrain(t *testing.T) {
|
||||||
switch {
|
switch {
|
||||||
case recovered != nil && !sawFatal:
|
case recovered != nil && !sawFatal:
|
||||||
t.Fatalf("got panic: %v", recovered)
|
t.Fatalf("got panic: %v", recovered)
|
||||||
case test.expectDelete && test.expectFatal && !sawFatal:
|
case test.expectFatal && !sawFatal:
|
||||||
t.Fatalf("%s: unexpected non-error when using %s", test.description, currMethod)
|
t.Fatalf("%s: unexpected non-error when using %s", test.description, currMethod)
|
||||||
case !test.expectFatal && sawFatal:
|
case !test.expectFatal && sawFatal:
|
||||||
t.Fatalf("%s: unexpected error when using %s: %s", test.description, currMethod, fatalMsg)
|
t.Fatalf("%s: unexpected error when using %s: %s", test.description, currMethod, fatalMsg)
|
||||||
|
@ -903,7 +903,7 @@ func TestDrain(t *testing.T) {
|
||||||
t.Fatalf("%s: same pod deleted %d times and evicted %d times", test.description, deletions, evictions)
|
t.Fatalf("%s: same pod deleted %d times and evicted %d times", test.description, deletions, evictions)
|
||||||
}
|
}
|
||||||
|
|
||||||
if test.expectDelete && len(test.expectWarning) > 0 {
|
if len(test.expectWarning) > 0 {
|
||||||
if len(errBuf.String()) == 0 {
|
if len(errBuf.String()) == 0 {
|
||||||
t.Fatalf("%s: expected warning, but found no stderr output", test.description)
|
t.Fatalf("%s: expected warning, but found no stderr output", test.description)
|
||||||
}
|
}
|
||||||
|
|
|
@ -180,12 +180,13 @@ func (d *Helper) GetPodsForDeletion(nodeName string) (*podDeleteList, []error) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if status.delete {
|
// Add the pod to podDeleteList no matter what podDeleteStatus is,
|
||||||
pods = append(pods, podDelete{
|
// those pods whose podDeleteStatus is false like DaemonSet will
|
||||||
pod: pod,
|
// be catched by list.errors()
|
||||||
status: status,
|
pods = append(pods, podDelete{
|
||||||
})
|
pod: pod,
|
||||||
}
|
status: status,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
list := &podDeleteList{items: pods}
|
list := &podDeleteList{items: pods}
|
||||||
|
|
Loading…
Reference in New Issue