Skip to content

Commit c83c4d5

Browse files
authored
Merge pull request kubernetes#92184 from dims/set-better-default-for-loading-images
Set better default commands for loading images
2 parents 6dced80 + fbb4bb0 commit c83c4d5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

cluster/gce/gci/configure.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,16 @@ function try-load-docker-image {
376376
set +e
377377
local -r max_attempts=5
378378
local -i attempt_num=1
379-
until timeout 30 ${LOAD_IMAGE_COMMAND:-docker load -i} "${img}"; do
379+
380+
if [[ "${CONTAINER_RUNTIME_NAME:-}" == "docker" ]]; then
381+
load_image_command=${LOAD_IMAGE_COMMAND:-docker load -i}
382+
elif [[ "${CONTAINER_RUNTIME_NAME:-}" == "containerd" ]]; then
383+
load_image_command=${LOAD_IMAGE_COMMAND:-ctr -n=k8s.io images import}
384+
else
385+
load_image_command="${LOAD_IMAGE_COMMAND:-}"
386+
fi
387+
388+
until timeout 30 ${load_image_command} "${img}"; do
380389
if [[ "${attempt_num}" == "${max_attempts}" ]]; then
381390
echo "Fail to load docker image file ${img} after ${max_attempts} retries. Exit!!"
382391
exit 1

0 commit comments

Comments
 (0)