mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Merge pull request #6130 from dereknola/install_skip_options
Restore original INSTALL_K3S_SKIP_DOWNLOAD behavior
This commit is contained in:
commit
7710bcee06
2
.github/workflows/install.yaml
vendored
2
.github/workflows/install.yaml
vendored
@ -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
|
||||
|
14
install.sh
14
install.sh
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user