Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

fix: CONTAINERD_VERSION unbound variable in VHD build script #583

Merged
merged 8 commits into from Feb 26, 2019

Conversation

jackfrancis
Copy link
Member

@jackfrancis jackfrancis commented Feb 26, 2019

Reason for Change:

The $CONTAINERD_DOWNLOAD_URL was present as a global variable in the base k8s CSE install script, and depended upon $CONTAINERD_VERSION to construct itself. This removes $CONTAINERD_DOWNLOAD_URL from the global variable namespace to allow the CSE script to once again be generally sourced by another script (without having to pass a $CONTAINERD_VERSION env var).

Issue Fixed:

Requirements:

Notes:

@@ -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"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This (1) removes the need for a 2nd concatenation of the $CONTAINERD_DOWNLOAD_URL var, and (2) is arguably more maintainable

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm pending passing VHD pipeline + E2E

@@ -187,6 +186,7 @@ downloadAzureCNI() {
}

downloadContainerd() {
CONTAINERD_DOWNLOAD_URL="${CONTAINERD_DOWNLOAD_URL_BASE}cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we're already setting CONTAINERD_DOWNLOAD_URL in the VHD script itself so this will override it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no longer setting CONTAINERD_DOWNLOAD_URL in the VHD script

@CecileRobertMichon
Copy link
Contributor

If that helps I have a passing vhd build with https://github.com/Azure/aks-engine/pull/457/files

@codecov
Copy link

codecov bot commented Feb 26, 2019

Codecov Report

Merging #583 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #583   +/-   ##
=======================================
  Coverage   56.78%   56.78%           
=======================================
  Files          91       91           
  Lines       13894    13894           
=======================================
  Hits         7890     7890           
  Misses       5338     5338           
  Partials      666      666

@jackfrancis jackfrancis added this to In progress in backlog Feb 26, 2019
@@ -40,7 +40,7 @@ for CNI_PLUGIN_VERSION in $CNI_PLUGIN_VERSIONS; do
downloadCNI
done

for CONTAINERD_VERSION in $CONTAINERD_VERSIONS; do
for CONTAINERD_VERSION in ${CONTAINERD_VERSIONS}; do
Copy link
Contributor

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 until downloadContainerd is called? It had to be at the top of the file before because CONTAINERD_DOWNLOAD_URL was set at the top of the sourced file

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@acs-bot acs-bot added size/S and removed size/XS labels Feb 26, 2019
@@ -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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double [[ and ]] just because it's more idiomatic w/ the rest of the bash surface area

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@acs-bot
Copy link

acs-bot commented Feb 26, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CecileRobertMichon, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [CecileRobertMichon,jackfrancis]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@acs-bot acs-bot added the lgtm label Feb 26, 2019
@jackfrancis jackfrancis merged commit e2cf6ae into Azure:master Feb 26, 2019
backlog automation moved this from In progress to Done Feb 26, 2019
@jackfrancis jackfrancis deleted the vhd-build-containerd branch February 26, 2019 21:12
juhacket pushed a commit to juhacket/aks-engine that referenced this pull request Mar 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
backlog
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants