Skip to content

Commit

Permalink
Merge pull request #1563 from zzzhangqi/241126
Browse files Browse the repository at this point in the history
fix: if the image.tar download is not complete, execute again to continue the download
  • Loading branch information
zzzhangqi authored Nov 28, 2024
2 parents 0702c15 + 31c4c49 commit e9c613d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions script/install-cluster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ download_tarball() {
if [ ! -f "${INSTALL_RKE2_AGENT_IMAGES_DIR}/${RKE2_IMAGES_NAME}" ]; then
info "downloading images at ${RKE2_IMAGES_URL}/${RKE2_IMAGES_NAME}"
download "${INSTALL_RKE2_AGENT_IMAGES_DIR}/${RKE2_IMAGES_NAME}" "${RKE2_IMAGES_URL}/${RKE2_IMAGES_NAME}"
else
if [ "$(stat -c %s "${INSTALL_RKE2_AGENT_IMAGES_DIR}/${RKE2_IMAGES_NAME}")" != \
"$(curl -sI "${RKE2_IMAGES_URL}/${RKE2_IMAGES_NAME}" | grep -i Content-Length | awk '{print $2}' | tr -d '\r')" ]; then
info "downloading images at ${RKE2_IMAGES_URL}/${RKE2_IMAGES_NAME}"
download "${INSTALL_RKE2_AGENT_IMAGES_DIR}/${RKE2_IMAGES_NAME}" "${RKE2_IMAGES_URL}/${RKE2_IMAGES_NAME}"
fi
fi
fi
}
Expand Down

0 comments on commit e9c613d

Please sign in to comment.