mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Filter out non-RestartAlways mirror pod in restart test.
This commit is contained in:
parent
da007483bd
commit
d9d148f4d6
@ -32,17 +32,17 @@ import (
|
|||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
func isRestartNeverMirrorPod(p *api.Pod) bool {
|
func isNotRestartAlwaysMirrorPod(p *api.Pod) bool {
|
||||||
if !kubepod.IsMirrorPod(p) {
|
if !kubepod.IsMirrorPod(p) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return p.Spec.RestartPolicy == api.RestartPolicyNever
|
return p.Spec.RestartPolicy != api.RestartPolicyAlways
|
||||||
}
|
}
|
||||||
|
|
||||||
func filterIrrelevantPods(pods []*api.Pod) []*api.Pod {
|
func filterIrrelevantPods(pods []*api.Pod) []*api.Pod {
|
||||||
var results []*api.Pod
|
var results []*api.Pod
|
||||||
for _, p := range pods {
|
for _, p := range pods {
|
||||||
if isRestartNeverMirrorPod(p) {
|
if isNotRestartAlwaysMirrorPod(p) {
|
||||||
// Mirror pods with restart policy == Never will not get
|
// Mirror pods with restart policy == Never will not get
|
||||||
// recreated if they are deleted after the pods have
|
// recreated if they are deleted after the pods have
|
||||||
// terminated. For now, we discount such pods.
|
// terminated. For now, we discount such pods.
|
||||||
|
Loading…
Reference in New Issue
Block a user