mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
Check for either Docker or Containerd getting active for e2e_node tests
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
parent
fbb4bb0003
commit
01183e51f0
@ -376,16 +376,7 @@ function try-load-docker-image {
|
|||||||
set +e
|
set +e
|
||||||
local -r max_attempts=5
|
local -r max_attempts=5
|
||||||
local -i attempt_num=1
|
local -i attempt_num=1
|
||||||
|
until timeout 30 ${LOAD_IMAGE_COMMAND:-docker load -i} "${img}"; do
|
||||||
if [[ "${CONTAINER_RUNTIME_NAME:-}" == "docker" ]]; then
|
|
||||||
load_image_command=${LOAD_IMAGE_COMMAND:-docker load -i}
|
|
||||||
elif [[ "${CONTAINER_RUNTIME_NAME:-}" == "containerd" ]]; then
|
|
||||||
load_image_command=${LOAD_IMAGE_COMMAND:-ctr -n=k8s.io images import}
|
|
||||||
else
|
|
||||||
load_image_command="${LOAD_IMAGE_COMMAND:-}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
until timeout 30 ${load_image_command} "${img}"; do
|
|
||||||
if [[ "${attempt_num}" == "${max_attempts}" ]]; then
|
if [[ "${attempt_num}" == "${max_attempts}" ]]; then
|
||||||
echo "Fail to load docker image file ${img} after ${max_attempts} retries. Exit!!"
|
echo "Fail to load docker image file ${img} after ${max_attempts} retries. Exit!!"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -668,13 +668,15 @@ func createInstance(imageConfig *internalGCEImage) (string, error) {
|
|||||||
// TODO(random-liu): Remove the docker version check. Use some other command to check
|
// TODO(random-liu): Remove the docker version check. Use some other command to check
|
||||||
// instance readiness.
|
// instance readiness.
|
||||||
var output string
|
var output string
|
||||||
output, err = remote.SSH(name, "docker", "version")
|
output, err = remote.SSH(name, "sh", "-c",
|
||||||
|
"'systemctl list-units --type=service --state=running | grep -e docker -e containerd'")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
err = fmt.Errorf("instance %s not running docker daemon - Command failed: %s", name, output)
|
err = fmt.Errorf("instance %s not running docker/containerd daemon - Command failed: %s", name, output)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if !strings.Contains(output, "Server") {
|
if !strings.Contains(output, "docker.service") &&
|
||||||
err = fmt.Errorf("instance %s not running docker daemon - Server not found: %s", name, output)
|
!strings.Contains(output, "containerd.service") {
|
||||||
|
err = fmt.Errorf("instance %s not running docker/containerd daemon: %s", name, output)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
instanceRunning = true
|
instanceRunning = true
|
||||||
|
Loading…
Reference in New Issue
Block a user