Put version into metadata so that version won't be changed across
restart. Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
7cbc1c8dc3
commit
ec649079a9
@ -43,13 +43,12 @@ DEPLOY_PATH=${DEPLOY_PATH:-"cri-containerd-release"}
|
|||||||
# By default use the release tarball with cni built in.
|
# By default use the release tarball with cni built in.
|
||||||
PKG_PREFIX=${PKG_PREFIX:-"cri-containerd-cni"}
|
PKG_PREFIX=${PKG_PREFIX:-"cri-containerd-cni"}
|
||||||
|
|
||||||
# VERSION is the cri-containerd version to use. If not specified,
|
# VERSION is the cri-containerd version to use.
|
||||||
# the latest version will be used.
|
|
||||||
VERSION_METADATA="version"
|
VERSION_METADATA="version"
|
||||||
VERSION=$(fetch_metadata "${VERSION_METADATA}")
|
VERSION=$(fetch_metadata "${VERSION_METADATA}")
|
||||||
if [ -z "${VERSION}" ]; then
|
if [ -z "${VERSION}" ]; then
|
||||||
VERSION=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
|
echo "Version is not set."
|
||||||
https://storage.googleapis.com/${DEPLOY_PATH}/latest)
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# TARBALL_GCS_PATH is the path to download cri-containerd tarball for node e2e.
|
# TARBALL_GCS_PATH is the path to download cri-containerd tarball for node e2e.
|
||||||
|
@ -3,14 +3,14 @@ GCE_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
|
|
||||||
# TODO(random-liu): Upload release tarball to user's own GCS, and use it. We should
|
# TODO(random-liu): Upload release tarball to user's own GCS, and use it. We should
|
||||||
# not let all nodes of all users download tarball from cri-containerd-release.
|
# not let all nodes of all users download tarball from cri-containerd-release.
|
||||||
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh"
|
if [ -z "${CRI_CONTAINERD_VERSION:-}" ]; then
|
||||||
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh"
|
CRI_CONTAINERD_VERSION=$(curl -f --ipv4 --retry 6 --retry-delay 3 --silent --show-error \
|
||||||
if [ -n "${CRI_CONTAINERD_VERSION}" ]; then
|
https://storage.googleapis.com/cri-containerd-release/latest)
|
||||||
version=$(mktemp /tmp/version.XXXX)
|
|
||||||
echo "${CRI_CONTAINERD_VERSION}" > "$version"
|
|
||||||
export KUBE_MASTER_EXTRA_METADATA="${KUBE_MASTER_EXTRA_METADATA},version=${version}"
|
|
||||||
export KUBE_NODE_EXTRA_METADATA="${KUBE_NODE_EXTRA_METADATA},version=${version}"
|
|
||||||
fi
|
fi
|
||||||
|
version_file=$(mktemp /tmp/version.XXXX)
|
||||||
|
echo "${CRI_CONTAINERD_VERSION}" > "$version_file"
|
||||||
|
export KUBE_MASTER_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/master.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
|
||||||
|
export KUBE_NODE_EXTRA_METADATA="user-data=${GCE_DIR}/cloud-init/node.yaml,cri-containerd-configure-sh=${GCE_DIR}/configure.sh,version=${version_file}"
|
||||||
export KUBE_CONTAINER_RUNTIME="remote"
|
export KUBE_CONTAINER_RUNTIME="remote"
|
||||||
export KUBE_CONTAINER_RUNTIME_ENDPOINT="/var/run/cri-containerd.sock"
|
export KUBE_CONTAINER_RUNTIME_ENDPOINT="/var/run/cri-containerd.sock"
|
||||||
export KUBE_LOAD_IMAGE_COMMAND="/home/cri-containerd/usr/local/bin/cri-containerd load"
|
export KUBE_LOAD_IMAGE_COMMAND="/home/cri-containerd/usr/local/bin/cri-containerd load"
|
||||||
|
Loading…
Reference in New Issue
Block a user