diff --git a/files/pull-sandbox-image.sh b/files/pull-sandbox-image.sh index 523e7ed4c..e1c1a6eb8 100644 --- a/files/pull-sandbox-image.sh +++ b/files/pull-sandbox-image.sh @@ -2,4 +2,10 @@ set -euo pipefail sandbox_image="$(awk -F'[ ="]+' '$1 == "sandbox_image" { print $2 }' /etc/containerd/config.toml)" + +### Short-circuit fetching sandbox image if its already present +if [[ "$(sudo ctr --namespace k8s.io image ls | grep $sandbox_image)" != "" ]]; then + exit 0 +fi + /etc/eks/containerd/pull-image.sh "${sandbox_image}"