Skip to content

Commit

Permalink
e2e: allow installing cri-o from distro repos.
Browse files Browse the repository at this point in the history
Don't insist installing cri-o from sources. Add support for
installing cri-o from distro repos for Fedora and CentOS-8.
  • Loading branch information
klihub committed Aug 23, 2021
1 parent e88fd74 commit a49d762
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
21 changes: 21 additions & 0 deletions demo/lib/distro.bash
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,15 @@ centos-7-install-containerd-pre() {
distro-install-repo https://download.docker.com/linux/centos/docker-ce.repo
}

centos-8-install-crio-pre() {
if [ -z "$crio_src" ]; then
local os=CentOS_8
local version=${crio_version:-1.20}
vm-command "curl -L -o /etc/yum.repos.d/libcontainers-stable.repo https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/$os/devel:kubic:libcontainers:stable.repo"
vm-command "curl -L -o /etc/yum.repos.d/crio.repo https://download.opensuse.org/repositories/devel:kubic:libcontainers:stable:cri-o:$version/$os/devel:kubic:libcontainers:stable:cri-o:$version.repo"
fi
}

centos-8-install-containerd-pre() {
distro-install-repo https://download.docker.com/linux/centos/docker-ce.repo
}
Expand Down Expand Up @@ -371,6 +380,18 @@ fedora-install-golang() {
fedora-install-crio-pre() {
distro-install-pkg runc conmon
vm-command "ln -sf /usr/lib64/libdevmapper.so.1.02 /usr/lib64/libdevmapper.so.1.02.1" || true

if [ -z "$crio_src" ]; then
vm-command "dnf -y module enable cri-o:${crio_version:-1.20}"
fi
}

fedora-install-crio() {
if [ -n "$crio_src" ]; then
default-install-crio
else
distro-install-pkg cri-o
fi
}

fedora-install-containerd-pre() {
Expand Down
6 changes: 5 additions & 1 deletion test/e2e/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ usage() {
echo " crio_src:"
echo " \"/host/path/to/go/project\": replace vm /usr/bin binaries"
echo " from /host/path/to/go/project/bin directory."
echo " Must be set if crio is a part of \$k8scri."
echo " Must be set if crio is a part of \$k8scri and the vm distro"
echo " does not have (or implement installing) cri-o packages."
echo " crirm_src:"
echo " \"/host/path/to/go/project\": replace vm /usr/local/bin binaries"
echo " from /host/path/to/go/project/bin directory."
Expand Down Expand Up @@ -106,6 +107,8 @@ usage() {
echo " \"containerd\" containerd, no cri-resmgr."
echo " \"crio\" cri-o, no cri-resmgr."
echo " The default is \"cri-resmgr|containerd\"."
echo " crio_version: Version of cri-o to try to pull in, if cri-o is"
echo " not being installed from sources."
echo ""
echo " Test input VARs:"
echo " cri_resmgr_cfg: configuration file forced to cri-resmgr."
Expand Down Expand Up @@ -1020,6 +1023,7 @@ containerd_src=${containerd_src:=}
crio_src=${crio_src:=}
crirm_src=${crirm_src:=$HOST_PROJECT_DIR}
runc_src=${runc_src:=}
crio_version=${crio_version:=}
BIN_DIR=${crirm_src}/bin
TOPOLOGY_DIR=${TOPOLOGY_DIR:=e2e}
vm=${vm:=$(basename ${TOPOLOGY_DIR})-${distro}-${cri}}
Expand Down

0 comments on commit a49d762

Please sign in to comment.