From 4dd828414f6847c3c25aef1c5d824894bdb3ffde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= Date: Thu, 13 Jul 2023 13:31:37 +0200 Subject: [PATCH] ci: Add install_cri_containerd() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This function will install cri-containerd in the host, and soon enough (as part of this PR) we'll be using it to install cri-containerd as part of the cri-containerd tests. I've decided to have this as part of the `common.bash` as other tests that will be added in the future will require cri-containerd to be installed as well. Signed-off-by: Fabiano FidĂȘncio --- tests/common.bash | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/common.bash b/tests/common.bash index ea48d5eff..83051d33b 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -371,3 +371,20 @@ function download_github_project_tarball() { wget https://github.com/${project}/releases/download/${version}/${tarball_name} } + +# base_version: The version to be intalled in the ${major}.${minor} format +function install_cri_containerd() { + base_version="${1}" + + project="containerd/containerd" + version=$(get_latest_patch_release_from_a_github_project "${project}" "${base_version}") + + tarball_name="cri-containerd-cni-${version//v}-linux-$(${repo_root_dir}/tests/kata-arch.sh -g).tar.gz" + + download_github_project_tarball "${project}" "${version}" "${tarball_name}" + sudo tar -xvf "${tarball_name}" -C / + rm -f "${tarball_name}" + + sudo mkdir -p /etc/containerd + containerd config default | sudo tee /etc/containerd/config.toml +}