Unverified Commit eb3e4c15 authored by Vincent Batts's avatar Vincent Batts Committed by GitHub

install.sh: support install on Flatcar with no args (#2551)

* install.sh: test if BIN_DIR is readonly, else use /opt On flatcar /usr is a readonly partition, while /opt is allowed for writing. Signed-off-by: 's avatarVincent Batts <vbatts@kinvolk.io> * install.sh: only warn on Flatcar about selinux This check is a bit more explicit, but only warn about finding the rpm installed policy when on Flatcar Container Linux Signed-off-by: 's avatarVincent Batts <vbatts@kinvolk.io> * Update install.sh Co-authored-by: 's avatarBrad Davidson <brad@oatmail.org> Signed-off-by: 's avatarVincent Batts <vbatts@kinvolk.io> Co-authored-by: 's avatarBrad Davidson <brad@oatmail.org>
parent e43a9096
...@@ -224,7 +224,9 @@ setup_env() { ...@@ -224,7 +224,9 @@ setup_env() {
if [ -n "${INSTALL_K3S_BIN_DIR}" ]; then if [ -n "${INSTALL_K3S_BIN_DIR}" ]; then
BIN_DIR=${INSTALL_K3S_BIN_DIR} BIN_DIR=${INSTALL_K3S_BIN_DIR}
else else
# --- use /usr/local/bin if we can write to it, otherwise try /opt
BIN_DIR=/usr/local/bin BIN_DIR=/usr/local/bin
touch ${BIN_DIR}/k3s-ro-test 2>/dev/null && rm -rf ${BIN_DIR}/k3s-ro-test || BIN_DIR=/opt/bin
fi fi
# --- use systemd directory if defined or create default --- # --- use systemd directory if defined or create default ---
...@@ -454,7 +456,7 @@ setup_selinux() { ...@@ -454,7 +456,7 @@ setup_selinux() {
yum install -y https://${rpm_site}/k3s/${rpm_channel}/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm yum install -y https://${rpm_site}/k3s/${rpm_channel}/common/centos/7/noarch/k3s-selinux-0.2-1.el7_8.noarch.rpm
" "
policy_error=fatal policy_error=fatal
if [ "$INSTALL_K3S_SELINUX_WARN" = true ]; then if [ "$INSTALL_K3S_SELINUX_WARN" = true ] || grep -q 'ID=flatcar' /etc/os-release; then
policy_error=warn policy_error=warn
fi fi
......
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