mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-23 18:40:53 +00:00
Merge pull request #94229 from derekwaynecarr/verify-container-state-running
Verify running mirror pod has running containers
This commit is contained in:
commit
2ca9ee3928
@ -192,6 +192,11 @@ func checkMirrorPodRunning(cl clientset.Interface, name, namespace string) error
|
|||||||
if pod.Status.Phase != v1.PodRunning {
|
if pod.Status.Phase != v1.PodRunning {
|
||||||
return fmt.Errorf("expected the mirror pod %q to be running, got %q", name, pod.Status.Phase)
|
return fmt.Errorf("expected the mirror pod %q to be running, got %q", name, pod.Status.Phase)
|
||||||
}
|
}
|
||||||
|
for i := range pod.Status.ContainerStatuses {
|
||||||
|
if pod.Status.ContainerStatuses[i].State.Running == nil {
|
||||||
|
return fmt.Errorf("expected the mirror pod %q with container %q to be running", name, pod.Status.ContainerStatuses[i].Name)
|
||||||
|
}
|
||||||
|
}
|
||||||
return validateMirrorPod(cl, pod)
|
return validateMirrorPod(cl, pod)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user