mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-08-08 23:37:11 +00:00
e2e_node: verify restart looping container correctly
when a test is verifying a container has restarted, we use a continually exiting container. Not verifying the number of restarts is less than (rather than equal) introduces a race between the container restarting and the status observation. Signed-off-by: Peter Hunt <pehunt@redhat.com>
This commit is contained in:
@@ -328,7 +328,7 @@ func verifyPodRestartCount(ctx context.Context, f *framework.Framework, podName
|
||||
updatedPod.Name, expectedNumContainers, len(updatedPod.Status.ContainerStatuses))
|
||||
}
|
||||
for _, containerStatus := range updatedPod.Status.ContainerStatuses {
|
||||
if containerStatus.RestartCount != expectedRestartCount {
|
||||
if containerStatus.RestartCount < expectedRestartCount {
|
||||
return fmt.Errorf("pod %s had container with restartcount %d. Should have been at least %d",
|
||||
updatedPod.Name, containerStatus.RestartCount, expectedRestartCount)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user