mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #84562 from yutedz/drain-filter
Only put un-filtered pod in podDeleteList
This commit is contained in:
commit
1aece964da
@ -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.expectFatal && !sawFatal:
|
case test.expectDelete && 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 len(test.expectWarning) > 0 {
|
if test.expectDelete && 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)
|
||||||
}
|
}
|
||||||
|
@ -155,10 +155,12 @@ func (d *Helper) GetPodsForDeletion(nodeName string) (*podDeleteList, []error) {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pods = append(pods, podDelete{
|
if status.delete {
|
||||||
pod: pod,
|
pods = append(pods, podDelete{
|
||||||
status: status,
|
pod: pod,
|
||||||
})
|
status: status,
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
list := &podDeleteList{items: pods}
|
list := &podDeleteList{items: pods}
|
||||||
|
Loading…
Reference in New Issue
Block a user