[ubuntu] Refactor bash functions (#9055)

This commit is contained in:
Shamil Mubarakshin
2023-12-26 12:50:52 +01:00
committed by GitHub
parent d16bc5f120
commit 503ae89818
38 changed files with 191 additions and 224 deletions

View File

@@ -10,14 +10,14 @@ source $HELPER_SCRIPTS/os.sh
# pin podman due to https://github.com/actions/runner-images/issues/7753
# https://bugs.launchpad.net/ubuntu/+source/libpod/+bug/2024394
#
if isUbuntu20; then
if is_ubuntu20; then
install_packages=(podman buildah skopeo)
else
install_packages=(podman=3.4.4+ds1-1ubuntu1 buildah skopeo)
fi
# Packages is available in the official Ubuntu upstream starting from Ubuntu 21
if isUbuntu20; then
if is_ubuntu20; then
REPO_URL="https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable"
source /etc/os-release
sh -c "echo 'deb ${REPO_URL}/x${NAME}_${VERSION_ID}/ /' > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list"
@@ -31,7 +31,7 @@ apt-get -y install ${install_packages[@]}
mkdir -p /etc/containers
printf "[registries.search]\nregistries = ['docker.io', 'quay.io']\n" | tee /etc/containers/registries.conf
if isUbuntu20; then
if is_ubuntu20; then
# Remove source repo
rm /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list
# Document source repo