-
Notifications
You must be signed in to change notification settings - Fork 527
fix: CONTAINERD_VERSION unbound variable in VHD build script #583
Changes from all commits
af89b75
b8ec0da
4773fa8
2e0fa23
f3f3af9
a3f9aff
fc56593
fe50e9c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ CNI_CONFIG_DIR="/etc/cni/net.d" | |
CNI_BIN_DIR="/opt/cni/bin" | ||
CNI_DOWNLOADS_DIR="/opt/cni/downloads" | ||
CONTAINERD_DOWNLOADS_DIR="/opt/containerd/downloads" | ||
CONTAINERD_DOWNLOAD_URL="${CONTAINERD_DOWNLOAD_URL_BASE}cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz" | ||
|
||
removeEtcd() { | ||
rm -rf /usr/bin/etcd | ||
|
@@ -187,6 +186,7 @@ downloadAzureCNI() { | |
} | ||
|
||
downloadContainerd() { | ||
CONTAINERD_DOWNLOAD_URL="${CONTAINERD_DOWNLOAD_URL_BASE}cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we're already setting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. no longer setting |
||
mkdir -p $CONTAINERD_DOWNLOADS_DIR | ||
CONTAINERD_TGZ_TMP=$(echo ${CONTAINERD_DOWNLOAD_URL} | cut -d "/" -f 5) | ||
retrycmd_get_tarball 120 5 "$CONTAINERD_DOWNLOADS_DIR/${CONTAINERD_TGZ_TMP}" ${CONTAINERD_DOWNLOAD_URL} || exit $ERR_CONTAINERD_DOWNLOAD_TIMEOUT | ||
|
@@ -220,7 +220,7 @@ installContainerd() { | |
if [[ "$CURRENT_VERSION" == "${CONTAINERD_VERSION}" ]]; then | ||
echo "containerd is already installed, skipping install" | ||
else | ||
CONTAINERD_TGZ_TMP=$(echo ${CONTAINERD_DOWNLOAD_URL} | cut -d "/" -f 5) | ||
CONTAINERD_TGZ_TMP="cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This (1) removes the need for a 2nd concatenation of the |
||
rm -Rf /usr/bin/containerd | ||
rm -Rf /var/lib/docker/containerd | ||
rm -Rf /run/docker/containerd | ||
|
@@ -278,7 +278,7 @@ installKubeletAndKubectl() { | |
pullContainerImage() { | ||
CLI_TOOL=$1 | ||
DOCKER_IMAGE_URL=$2 | ||
if [ ! -z "${PRIVATE_AZURE_REGISTRY_SERVER}" ]; then | ||
if [[ ! -z "${PRIVATE_AZURE_REGISTRY_SERVER:-}" ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. double |
||
$CLI_TOOL login -u $SERVICE_PRINCIPAL_CLIENT_ID -p $SERVICE_PRINCIPAL_CLIENT_SECRET $PRIVATE_AZURE_REGISTRY_SERVER | ||
fi | ||
retrycmd_if_failure 60 1 1200 $CLI_TOOL pull $DOCKER_IMAGE_URL || exit $ERR_CONTAINER_IMG_PULL_TIMEOUT | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move
CONTAINERD_DOWNLOAD_URL_BASE
down here now that it's not used untildownloadContainerd
is called? It had to be at the top of the file before becauseCONTAINERD_DOWNLOAD_URL
was set at the top of the sourced fileThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm being picky but the var assignment doesn't need to be inside the for loop since it's static
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done