Skip to content

Commit 3bc1d35

Browse files
Random-Liuestesp
authored andcommitted
Put version into metadata so that version won't be changed across
restart. Signed-off-by: Lantao Liu <[email protected]>
1 parent 544e0e7 commit 3bc1d35

2 files changed

Lines changed: 10 additions & 11 deletions

File tree

contrib/gce/configure.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,12 @@ DEPLOY_PATH=${DEPLOY_PATH:-"cri-containerd-release"}
4343
# By default use the release tarball with cni built in.
4444
PKG_PREFIX=${PKG_PREFIX:-"cri-containerd-cni"}
4545

46-
# VERSION is the cri-containerd version to use. If not specified,
47-
# the latest version will be used.
46+
# VERSION is the cri-containerd version to use.
4847
VERSION_METADATA="version"
4948
VERSION=$(fetch_metadata "${VERSION_METADATA}")
5049
if [ -z "${VERSION}" ]; then
51-
VERSION=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
52-
https://storage.googleapis.com/${DEPLOY_PATH}/latest)
50+
echo "Version is not set."
51+
exit 1
5352
fi
5453

5554
# TARBALL_GCS_PATH is the path to download cri-containerd tarball for node e2e.

contrib/gce/env

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ GCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
33

44
# TODO(random-liu): Upload release tarball to user's own GCS, and use it. We should
55
# not let all nodes of all users download tarball from cri-containerd-release.
6-
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh"
7-
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh"
8-
if [ -n "${CRI_CONTAINERD_VERSION}" ]; then
9-
version=$(mktemp /tmp/version.XXXX)
10-
echo "${CRI_CONTAINERD_VERSION}" > "$version"
11-
export KUBE_MASTER_EXTRA_METADATA="${KUBE_MASTER_EXTRA_METADATA},version=${version}"
12-
export KUBE_NODE_EXTRA_METADATA="${KUBE_NODE_EXTRA_METADATA},version=${version}"
6+
if [ -z "${CRI_CONTAINERD_VERSION:-}" ]; then
7+
CRI_CONTAINERD_VERSION=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
8+
https://storage.googleapis.com/cri-containerd-release/latest)
139
fi
10+
version_file=$(mktemp /tmp/version.XXXX)
11+
echo "${CRI_CONTAINERD_VERSION}" > "$version_file"
12+
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
13+
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
1414
export KUBE_CONTAINER_RUNTIME="remote"
1515
export KUBE_CONTAINER_RUNTIME_ENDPOINT="/var/run/cri-containerd.sock"
1616
export KUBE_LOAD_IMAGE_COMMAND="/home/cri-containerd/usr/local/bin/cri-containerd load"

0 commit comments

Comments
 (0)