Skip to content

Commit

Permalink
fix: azcopy download with checksum verification - review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jan 6, 2024
1 parent d0a7062 commit 0ca9e28
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion parts/linux/cloud-init/artifacts/cse_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ extractPrivateKubeBinaries() {
return 1
fi

# remove the current kubelet binaries before extracting new binaries from the cached package
# remove the current kubelet and kubectl binaries before extracting new binaries from the cached package
rm -rf /usr/local/bin/kubelet-* /usr/local/bin/kubectl-*

retrycmd_get_tarball 120 5 "${cached_pkg}" ${kube_binary_url} || exit $ERR_PRIVATE_K8S_PKG_ERR
Expand All @@ -264,6 +264,7 @@ extractPrivateKubeBinaries() {
}

installKubeletKubectlAndKubeProxy() {
# when both, custom and private urls for kubernetes packages are set, custom url will be used and private url will be ignored
CUSTOM_KUBE_BINARY_DOWNLOAD_URL="${CUSTOM_KUBE_BINARY_URL:=}"
PRIVATE_KUBE_BINARY_DOWNLOAD_URL="${PRIVATE_KUBE_BINARY_URL:=}"
echo "using private url: ${PRIVATE_KUBE_BINARY_DOWNLOAD_URL}, custom url: ${CUSTOM_KUBE_BINARY_DOWNLOAD_URL}"
Expand Down
3 changes: 2 additions & 1 deletion pkg/templates/templates_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 14 additions & 8 deletions vhdbuilder/scripts/linux/tool_installs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,25 @@ getAzCopyCurrentPath() {
else
echo "get azcopy at \"${PWD}\"...start"
# Download and extract
azcopydownloadurl="https://aka.ms/downloadazcopy-v10-linux"
azcopydownloadurl="https://azcopyvnext.azureedge.net/releases/release-10.22.1-20231220/azcopy_linux_amd64_10.22.1.tar.gz"
azcopysha256="7549424d56ab2d8b4033c84c2a9bb167dc2dcbb23998acd7fffb37bc1a71a267"
if [[ $(isARM64) == 1 ]]; then
azcopydownloadurl="https://aka.ms/downloadazcopy-v10-linux-arm64"
azcopydownloadurl="https://azcopyvnext.azureedge.net/releases/release-10.22.1-20231220/azcopy_linux_arm64_10.22.1.tar.gz"
azcopysha256="4db9a4b48abc7775f1a5d6d928afc42361dcc57bbfcde23ac82e4c419a0dc8fc"
fi
wget "$azcopydownloadurl" -O "downloadazcopy"
tar -xvf ./downloadazcopy

rm -f ./azcopy
cp ./azcopy_linux_*/azcopy ./azcopy
downloadedpkg="downloadazcopy"
pkgprefix="azcopy_linux_"

wget "$azcopydownloadurl" -O "$downloadedpkg" &&
echo "$azcopysha256 $downloadedpkg" | sha256sum --check >/dev/null &&
tar -xvf ./$downloadedpkg &&
cp ./$pkgprefix*/azcopy ./azcopy &&
chmod +x ./azcopy

rm -f downloadazcopy
rm -rf ./azcopy_linux_*/
rm -f $downloadedpkg
rm -rf ./$pkgprefix*/

echo "get azcopy...done"
fi
}

0 comments on commit 0ca9e28

Please sign in to comment.