mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #37203 from Random-Liu/fix-restart-test
Automatic merge from submit-queue Filter out non-RestartAlways mirror pod in restart test. Fixes #37202. > A quick fix is to filter out non-RestartAlways pods. Because either RestartNever and RestartOnFailure pods could succeed, and we can not deal with terminated mirror pods very well now. @yujuhong @gmarek /cc @kubernetes/sig-node
This commit is contained in:
commit
ab20072189
@ -32,17 +32,17 @@ import (
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
func isRestartNeverMirrorPod(p *api.Pod) bool {
|
||||
func isNotRestartAlwaysMirrorPod(p *api.Pod) bool {
|
||||
if !kubepod.IsMirrorPod(p) {
|
||||
return false
|
||||
}
|
||||
return p.Spec.RestartPolicy == api.RestartPolicyNever
|
||||
return p.Spec.RestartPolicy != api.RestartPolicyAlways
|
||||
}
|
||||
|
||||
func filterIrrelevantPods(pods []*api.Pod) []*api.Pod {
|
||||
var results []*api.Pod
|
||||
for _, p := range pods {
|
||||
if isRestartNeverMirrorPod(p) {
|
||||
if isNotRestartAlwaysMirrorPod(p) {
|
||||
// Mirror pods with restart policy == Never will not get
|
||||
// recreated if they are deleted after the pods have
|
||||
// terminated. For now, we discount such pods.
|
||||
|
Loading…
Reference in New Issue
Block a user