From ab6846e4f731745d6acf81dd513c28c3086c34be Mon Sep 17 00:00:00 2001 From: "fupan.lfp" Date: Thu, 17 Jun 2021 22:28:38 +0800 Subject: [PATCH] containerd: fix the issue of getting cri version Since 1.5.0, containerd had embedded cri and there's no need to get the cri version. Depends-on: github.com/kata-containers/kata-containers#2040 Fixes:#3630 Signed-off-by: fupan.lfp --- .ci/install_cri_containerd.sh | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/.ci/install_cri_containerd.sh b/.ci/install_cri_containerd.sh index 0b78db4b25..59bce0bdd3 100755 --- a/.ci/install_cri_containerd.sh +++ b/.ci/install_cri_containerd.sh @@ -13,7 +13,6 @@ set -o errtrace source /etc/os-release || source /usr/lib/os-release script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cri_repository="github.com/containerd/cri" # Flag to do tasks for CI CI=${CI:-""} @@ -29,9 +28,7 @@ CONTAIENRD_ARCH=$(go env GOARCH) cri_containerd_tarball_version=$(get_version "externals.cri-containerd.version") cri_containerd_repo=$(get_version "externals.cri-containerd.url") -echo "Get cri_containerd version" -cri_containerd_version_url="https://raw.githubusercontent.com/containerd/containerd/${cri_containerd_tarball_version}/vendor.conf" -cri_containerd_version=$(curl -sL $cri_containerd_version_url | grep "github.com/containerd/cri" | awk '{print $2}') +cri_containerd_version=${cri_containerd_tarball_version#v} echo "Set up environment" if [ "$ID" == centos ] || [ "$ID" == rhel ]; then @@ -42,24 +39,21 @@ fi install_from_source() { echo "Trying to install containerd from source" ( - cd "${GOPATH}/src/${cri_repository}" >>/dev/null + cd "${GOPATH}/src/${cri_containerd_repo}" >>/dev/null git fetch - git checkout "${cri_containerd_version}" - make BUILDTAGS="${BUILD_TAGS:-}" release - local commit - commit=$(git rev-parse --short HEAD) - tarball_name="cri-containerd-${commit}.${CONTAINERD_OS}-${CONTAIENRD_ARCH}.tar.gz" - sudo tar -xvf "./_output/${tarball_name}" -C / + git checkout "${cri_containerd_tarball_version}" + make BUILDTAGS="${BUILD_TAGS:-}" cri-cni-release + tarball_name="cri-containerd-cni-${cri_containerd_version}-${CONTAINERD_OS}-${CONTAIENRD_ARCH}.tar.gz" + sudo tar -xvf "./releases/${tarball_name}" -C / ) } install_from_static_tarball() { echo "Trying to install containerd from static tarball" local tarball_url=$(get_version "externals.cri-containerd.tarball_url") - cri_containerd_tarball_version="${cri_containerd_tarball_version/v/}" - local tarball_name="cri-containerd-${cri_containerd_tarball_version}.${CONTAINERD_OS}-${CONTAIENRD_ARCH}.tar.gz" - local url="${tarball_url}/${tarball_name}" + local tarball_name="cri-containerd-cni-${cri_containerd_version}-${CONTAINERD_OS}-${CONTAIENRD_ARCH}.tar.gz" + local url="${tarball_url}/${cri_containerd_tarball_version}/${tarball_name}" echo "Download tarball from ${url}" if ! curl -OL -f "${url}"; then @@ -68,12 +62,6 @@ install_from_static_tarball() { fi sudo tar -xvf "${tarball_name}" -C / - echo "vendored cri version ${cri_containerd_version}" - ( - cd "${GOPATH}/src/${cri_containerd_repo}" >>/dev/null - echo "checkout to cri version ${cri_containerd_version}" - git checkout "${cri_containerd_version}" - ) } go get "${cri_containerd_repo}"