Merge pull request #6130 from dereknola/install_skip_options

Restore original INSTALL_K3S_SKIP_DOWNLOAD behavior
This commit is contained in:
Derek Nola 2022-09-13 15:49:03 -07:00 committed by GitHub
commit 7710bcee06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View File

@ -43,7 +43,7 @@ jobs:
run:
working-directory: tests/install/${{ matrix.vm }}
env:
INSTALL_K3S_SKIP_DOWNLOAD: true
INSTALL_K3S_SKIP_DOWNLOAD: binary
steps:
- name: "Checkout"
uses: actions/checkout@v2

View File

@ -269,12 +269,18 @@ setup_env() {
}
# --- check if skip download environment variable set ---
can_skip_download() {
if [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != true ]; then
can_skip_download_binary() {
if [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != true ] && [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != binary ]; then
return 1
fi
}
can_skip_download_selinux() {
if [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != true ] && [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != selinux ]; then
return 1
fi
}
# --- verify an executable k3s binary is installed ---
verify_k3s_is_executable() {
if [ ! -x ${BIN_DIR}/k3s ]; then
@ -483,7 +489,7 @@ setup_selinux() {
${package_installer} install -y https://${rpm_site}/k3s/${rpm_channel}/common/${rpm_site_infix}/noarch/k3s-selinux-0.4-1.${rpm_target}.noarch.rpm
"
if [ "$INSTALL_K3S_SKIP_SELINUX_RPM" = true ] || [ ! -d /usr/share/selinux ]; then
if [ "$INSTALL_K3S_SKIP_SELINUX_RPM" = true ] || can_skip_download_selinux || [ ! -d /usr/share/selinux ]; then
info "Skipping installation of SELinux RPM"
elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then
install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix}
@ -552,7 +558,7 @@ EOF
# --- download and verify k3s ---
download_and_verify() {
if can_skip_download; then
if can_skip_download_binary; then
info 'Skipping k3s download and verify'
verify_k3s_is_executable
return