mirror of
https://github.com/kairos-io/provider-k3s.git
synced 2025-08-10 18:21:37 +00:00
20 lines
479 B
Bash
20 lines
479 B
Bash
|
#!/bin/bash -x
|
||
|
|
||
|
CONTENT_PATH=$1
|
||
|
# find all tar files recursively
|
||
|
for tarfile in $(find $CONTENT_PATH -name "*.tar" -type f)
|
||
|
do
|
||
|
# try to import the tar file into containerd up to ten times
|
||
|
for i in {1..10}
|
||
|
do
|
||
|
ctr -n k8s.io image import $tarfile --all-platforms
|
||
|
if [ $? -eq 0 ]; then
|
||
|
echo "Import successful: $tarfile (attempt $i)"
|
||
|
break
|
||
|
else
|
||
|
if [ $i -eq 10 ]; then
|
||
|
echo "Import failed: $tarfile (attempt $i)"
|
||
|
fi
|
||
|
fi
|
||
|
done
|
||
|
done
|