mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Use the minimum recommended version of cri-tools for containerd tests.
PiperOrigin-RevId: 733575043
This commit is contained in:
@@ -31,7 +31,6 @@ CONTAINERD_MAJOR="$(echo "${CONTAINERD_VERSION}" | awk -F '.' '{ print $1; }')"
|
||||
declare -r CONTAINERD_MAJOR
|
||||
CONTAINERD_MINOR="$(echo "${CONTAINERD_VERSION}" | awk -F '.' '{ print $2; }')"
|
||||
declare -r CONTAINERD_MINOR
|
||||
declare -r CRITOOLS_VERSION=${CRITOOLS_VERSION:-1.18.0}
|
||||
|
||||
if [[ "${CONTAINERD_MAJOR}" -eq 1 ]] && [[ "${CONTAINERD_MINOR}" -le 4 ]]; then
|
||||
# We're running Go 1.18, but using pre-module containerd and cri-tools.
|
||||
@@ -61,6 +60,23 @@ install_helper() {
|
||||
make install)
|
||||
}
|
||||
|
||||
# Helper to get cri-tools version for the given containerd version.
|
||||
get_critools_version() {
|
||||
declare -r CONTAINERD_PACKAGE="${1}"
|
||||
declare -r CONTAINERD_TAG="${2}"
|
||||
declare -r CONTAINERD_PATH="${GOPATH}"/src/"${CONTAINERD_PACKAGE}"
|
||||
declare -r CRITOOLS_VERSION_FILE="${CONTAINERD_PATH}"/script/setup/critools-version
|
||||
|
||||
local CRITOOLS_VERSION="v1.18.0"
|
||||
# If the containerd repository is already cloned, checkout the new tag.
|
||||
if [[ -f "$CRITOOLS_VERSION_FILE" ]]; then
|
||||
(cd "${CONTAINERD_PATH}" && git checkout "${CONTAINERD_TAG}")
|
||||
CRITOOLS_VERSION=$(cat "${CRITOOLS_VERSION_FILE}" | tr -d '\r\n')
|
||||
fi
|
||||
echo "$CRITOOLS_VERSION"
|
||||
return 0
|
||||
}
|
||||
|
||||
# Figure out were btrfs headers are.
|
||||
#
|
||||
# Ubuntu 16.04 has only btrfs-tools, while 18.04 has a transitional package,
|
||||
@@ -94,7 +110,9 @@ done
|
||||
GOPATH=$(mktemp -d --tmpdir gopathXXXXX)
|
||||
declare -rx GOPATH
|
||||
install_helper github.com/containerd/containerd "v${CONTAINERD_VERSION}"
|
||||
install_helper github.com/kubernetes-sigs/cri-tools "v${CRITOOLS_VERSION}"
|
||||
declare MINIMAL_CRITOOLS_VERSION
|
||||
MINIMAL_CRITOOLS_VERSION=$(get_critools_version github.com/containerd/containerd "v${CONTAINERD_VERSION}")
|
||||
install_helper github.com/kubernetes-sigs/cri-tools "${MINIMAL_CRITOOLS_VERSION}"
|
||||
|
||||
# Configure containerd-shim.
|
||||
declare -r shim_config_path=/etc/containerd/runsc/config.toml
|
||||
|
||||
Reference in New Issue
Block a user