The kubelet would attempt to create a new sandbox for a pod whose RestartPolicy is OnFailure even after all container succeeded. It caused unnecessary CRI and CNI calls, confusing logs and conflicts between the routine that creates the new sandbox and the routine that kills the Pod. This patch checks the containers to start and stops creating sandbox if no container is supposed to start.
WARNING: Do not add tests in this directory
There are two types of end-to-end tests in Kubernetes:
Tests located in ${KUBE_ROOT}/test/e2e/common are shared by both Cluster
and Node E2E test jobs. Tests in ${KUBE_ROOT}/test/e2e_node are exclusively
owned by Node E2E. If you want to add a test, most likely than not, you want
to add the test to one of the two directories mentioned above. If you are
unsure, please check with the OWNER of the directory. This directory currently
contains misplaced and legacy tests; they will be cleaned up in the future.