File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -376,9 +376,18 @@ function try-load-docker-image {
376
376
set +e
377
377
local -r max_attempts=5
378
378
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
380
389
if [[ " ${attempt_num} " == " ${max_attempts} " ]]; then
381
- echo " Fail to load docker image file ${img} after ${max_attempts} retries. Exit!!"
390
+ echo " Fail to load docker image file ${img} using ${load_image_command} after ${max_attempts} retries. Exit!!"
382
391
exit 1
383
392
else
384
393
attempt_num=$(( attempt_num+ 1 ))
You can’t perform that action at this time.
0 commit comments