Unverified Commit 7710bcee authored by Derek Nola's avatar Derek Nola Committed by GitHub

Merge pull request #6130 from dereknola/install_skip_options

Restore original INSTALL_K3S_SKIP_DOWNLOAD behavior
parents c1be599d 1deccc95
...@@ -43,7 +43,7 @@ jobs: ...@@ -43,7 +43,7 @@ jobs:
run: run:
working-directory: tests/install/${{ matrix.vm }} working-directory: tests/install/${{ matrix.vm }}
env: env:
INSTALL_K3S_SKIP_DOWNLOAD: true INSTALL_K3S_SKIP_DOWNLOAD: binary
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: actions/checkout@v2 uses: actions/checkout@v2
......
...@@ -269,12 +269,18 @@ setup_env() { ...@@ -269,12 +269,18 @@ setup_env() {
} }
# --- check if skip download environment variable set --- # --- check if skip download environment variable set ---
can_skip_download() { can_skip_download_binary() {
if [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != true ]; then if [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != true ] && [ "${INSTALL_K3S_SKIP_DOWNLOAD}" != binary ]; then
return 1 return 1
fi 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 an executable k3s binary is installed ---
verify_k3s_is_executable() { verify_k3s_is_executable() {
if [ ! -x ${BIN_DIR}/k3s ]; then if [ ! -x ${BIN_DIR}/k3s ]; then
...@@ -483,7 +489,7 @@ setup_selinux() { ...@@ -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 ${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" info "Skipping installation of SELinux RPM"
elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then elif [ "${ID_LIKE:-}" != coreos ] && [ "${VARIANT_ID:-}" != coreos ]; then
install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix} install_selinux_rpm ${rpm_site} ${rpm_channel} ${rpm_target} ${rpm_site_infix}
...@@ -552,7 +558,7 @@ EOF ...@@ -552,7 +558,7 @@ EOF
# --- download and verify k3s --- # --- download and verify k3s ---
download_and_verify() { download_and_verify() {
if can_skip_download; then if can_skip_download_binary; then
info 'Skipping k3s download and verify' info 'Skipping k3s download and verify'
verify_k3s_is_executable verify_k3s_is_executable
return return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment