Skip to content

Commit

Permalink
install_rpm_containerd: minor cleanup
Browse files Browse the repository at this point in the history
- use command -v for detecting dnf instead of the --version
- quote repo-IDs to prevent globbing by the shell

Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
thaJeztah committed Sep 4, 2024
1 parent 13aa3cb commit 33710d4
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions install-containerd-helpers
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ function install_rpm_containerd() {
# so this logic works for both cases.
# (See also same logic in install_debian_containerd)

if dnf --version; then
if command -v dnf; then
dnf --version

dnf config-manager --add-repo "${REPO_URL}"
dnf config-manager --set-disabled docker-ce-*
dnf config-manager --set-enabled docker-ce-test
dnf config-manager --set-disabled 'docker-ce-*'
dnf config-manager --set-enabled 'docker-ce-test'
dnf makecache
else
yum-config-manager --add-repo "${REPO_URL}"
yum-config-manager --disable docker-ce-*
yum-config-manager --enable docker-ce-test
yum-config-manager --disable 'docker-ce-*'
yum-config-manager --enable 'docker-ce-test'
yum makecache
fi
}
Expand Down

0 comments on commit 33710d4

Please sign in to comment.