From 78b2b393a228a2eda76cc0ea44d399162211d7da Mon Sep 17 00:00:00 2001 From: Ethan Mosbaugh Date: Mon, 27 Mar 2023 14:55:10 -0700 Subject: [PATCH] fix: persist kurl local host repos for rhel 9 (#4280) --- addons/rook/template/testgrid/k8s-docker.yaml | 4 ++ scripts/common/host-packages.sh | 39 ++++++++++--------- testgrid/specs/deploy.yaml | 16 ++++++++ 3 files changed, 40 insertions(+), 19 deletions(-) diff --git a/addons/rook/template/testgrid/k8s-docker.yaml b/addons/rook/template/testgrid/k8s-docker.yaml index b5c81be847..b0676863c8 100644 --- a/addons/rook/template/testgrid/k8s-docker.yaml +++ b/addons/rook/template/testgrid/k8s-docker.yaml @@ -22,7 +22,11 @@ . /etc/os-release case "$ID$VERSION_ID" in centos9*|rhel9*|ol9*|rocky9*) + # install required host packages yum install -y lvm2 conntrack-tools socat + # disable yum repos + find /etc/yum.repos.d/ -maxdepth 1 -name '*.repo' -exec mv "{}" "{}.bak" \; + yum clean metadata ;; esac postInstallScript: | diff --git a/scripts/common/host-packages.sh b/scripts/common/host-packages.sh index d799ccd740..2d3729119c 100644 --- a/scripts/common/host-packages.sh +++ b/scripts/common/host-packages.sh @@ -251,32 +251,39 @@ function _yum_install_host_packages_el9() { logStep "Installing host packages ${packages[*]}" local fullpath= - fullpath="$(_yum_get_host_packages_path "${dir}" "${dir_prefix}")" - if ! test -n "$(shopt -s nullglob; echo "${fullpath}"/*.rpm)" ; then + fullpath="$(_yum_get_host_packages_path "$dir" "$dir_prefix")" + if ! test -n "$(shopt -s nullglob; echo "$fullpath"/*.rpm)" ; then echo "Will not install host packages ${packages[*]}, no packages found." return 0 fi - cat > /etc/yum.repos.d/kurl.local.repo < "/etc/yum.repos.d/$reponame.repo" <