Skip to content

Commit

Permalink
simpler version managment
Browse files Browse the repository at this point in the history
  • Loading branch information
djsly committed Oct 12, 2024
1 parent 60df472 commit 8ebaf96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 3 additions & 2 deletions parts/linux/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,15 @@ downloadCrictl() {
}

installCrictl() {
local crictlVersion=${1}
CPU_ARCH=$(getCPUArch)
currentVersion=$(crictl --version 2>/dev/null | sed 's/crictl version //g')
if [[ "${currentVersion}" != "" ]]; then
echo "version ${currentVersion} of crictl already installed. skipping installCrictl of target version ${1%.*}.0"
echo "version ${currentVersion} of crictl already installed. skipping installCrictl of target version ${crictlVersion%.*}.0"
else
# this is only called during cse. VHDs should have crictl binaries pre-cached so no need to download.
# if the vhd does not have crictl pre-baked, return early
CRICTL_TGZ_TEMP="crictl-v${CRICTL_VERSION}-linux-${CPU_ARCH}.tar.gz"
CRICTL_TGZ_TEMP="crictl-v${crictlVersion}-linux-${CPU_ARCH}.tar.gz"
if [[ ! -f "$CRICTL_DOWNLOAD_DIR/${CRICTL_TGZ_TEMP}" ]]; then
rm -rf ${CRICTL_DOWNLOAD_DIR}
echo "pre-cached crictl not found: skipping installCrictl"
Expand Down
4 changes: 0 additions & 4 deletions vhdbuilder/packer/install-dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,6 @@ while IFS= read -r p; do
downloadCrictl "${downloadDir}" "${evaluatedURL}"
installCrictl "${version}"
echo " - crictl version ${version}" >> ${VHD_LOGS_FILEPATH}
# other steps are dependent on CRICTL_VERSION and CRICTL_VERSIONS
# since we only have 1 entry in CRICTL_VERSIONS, we simply set both to the same value
CRICTL_VERSION=${version}
CRICTL_VERSIONS=${version}
done
;;
"azure-cni")
Expand Down

0 comments on commit 8ebaf96

Please sign in to comment.