Skip to content

Commit

Permalink
Revert "Add el9 selinux rpm (#7443)" (#7608)
Browse files Browse the repository at this point in the history
This reverts commit d55ec08.

Signed-off-by: galal-hussein <hussein.galal.ahmed.11@gmail.com>
  • Loading branch information
galal-hussein authored May 25, 2023
1 parent d55ec08 commit 213d7ad
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 153 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
strategy:
fail-fast: false
matrix:
vm: [centos-7, rocky-8, rocky-9, fedora, opensuse-leap, ubuntu-focal]
vm: [centos-7, rocky-8, fedora, opensuse-leap, ubuntu-focal]
max-parallel: 2
defaults:
run:
Expand Down
41 changes: 3 additions & 38 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -518,17 +518,13 @@ setup_selinux() {
rpm_target=el7
rpm_site_infix=centos/7
package_installer=yum
elif [ "${VERSION_ID%%.*}" = "8" ] || [ "${VERSION_ID%%.*}" = "37" ]; then
rpm_target=el8
rpm_site_infix=centos/8
package_installer=yum
elif [ "${ID_LIKE:-}" = coreos ] || [ "${VARIANT_ID:-}" = coreos ]; then
rpm_target=coreos
rpm_site_infix=coreos
package_installer=rpm-ostree
else
rpm_target=el9
rpm_site_infix=centos/9
rpm_target=el8
rpm_site_infix=centos/8
package_installer=yum
fi

Expand Down Expand Up @@ -562,7 +558,7 @@ setup_selinux() {
$policy_error "Failed to apply container_runtime_exec_t to ${BIN_DIR}/k3s, ${policy_hint}"
fi
elif [ ! -f /usr/share/selinux/packages/k3s.pp ]; then
if [ -x /usr/sbin/transactional-update ] || [ "${ID_LIKE:-}" = coreos ] || [ "${VARIANT_ID:-}" = coreos ]; then
if [ -x /usr/sbin/transactional-update ]; then
warn "Please reboot your machine to activate the changes and avoid data loss."
else
$policy_error "Failed to find the k3s-selinux policy, ${policy_hint}"
Expand Down Expand Up @@ -596,12 +592,9 @@ EOF
sle)
rpm_installer="zypper --gpg-auto-import-keys"
if [ "${TRANSACTIONAL_UPDATE=false}" != "true" ] && [ -x /usr/sbin/transactional-update ]; then
transactional_update_run="transactional-update --no-selfupdate -d run"
rpm_installer="transactional-update --no-selfupdate -d run ${rpm_installer}"
: "${INSTALL_K3S_SKIP_START:=true}"
fi
# create the /var/lib/rpm-state in SLE systems to fix the prein selinux macro
${transactional_update_run} mkdir -p /var/lib/rpm-state
;;
coreos)
rpm_installer="rpm-ostree"
Expand All @@ -614,41 +607,13 @@ EOF
esac
if [ "${rpm_installer}" = "yum" ] && [ -x /usr/bin/dnf ]; then
rpm_installer=dnf
fi
if rpm -q --quiet k3s-selinux && [ "${3}" == "el9" ]; then
# remove k3s-selinux module in el9 before upgrade to allow container-selinux to upgrade safely
if check_available_upgrades container-selinux ${3} && check_available_upgrades k3s-selinux ${3}; then
MODULE_PRIORITY=$($SUDO semodule --list=full | grep k3s | cut -f1 -d" ")
if [ -n "${MODULE_PRIORITY}" ]; then
$SUDO semodule -X $MODULE_PRIORITY -r k3s || true
fi
fi
fi
# shellcheck disable=SC2086
$SUDO ${rpm_installer} install -y "k3s-selinux"
fi
return
}

check_available_upgrades() {
set +e
case ${2} in
sle)
available_upgrades=$($SUDO zypper -q -t -s 11 se -s -u --type package $1 | tail -n 1 | grep -v "No matching" | awk '{print $3}')
;;
coreos)
# currently rpm-ostree does not support search functionality https://github.com/coreos/rpm-ostree/issues/1877
;;
*)
available_upgrades=$($SUDO yum -q --refresh list $1 --upgrades | tail -n 1 | awk '{print $2}')
;;
esac
set -e
if [ -n "${available_upgrades}" ]; then
return 0
fi
return 1
}
# --- download and verify k3s ---
download_and_verify() {
if can_skip_download_binary; then
Expand Down
114 changes: 0 additions & 114 deletions tests/install/rocky-9/Vagrantfile

This file was deleted.

0 comments on commit 213d7ad

Please sign in to comment.