mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Set the selinux context during the install (#228)
* Set the selinux context
This commit is contained in:
parent
9dd60779a4
commit
397ae335fd
10
install.sh
10
install.sh
@ -262,6 +262,16 @@ setup_binary() {
|
||||
info "Installing k3s to ${BIN_DIR}/k3s"
|
||||
$SUDO chown root:root ${TMP_BIN}
|
||||
$SUDO mv -f ${TMP_BIN} ${BIN_DIR}/k3s
|
||||
|
||||
if command -v getenforce > /dev/null 2>&1; then
|
||||
if [ "Disabled" != `getenforce` ]; then
|
||||
info "SeLinux is enabled, setting permissions"
|
||||
if ! $SUDO semanage fcontext -l | grep "${BIN_DIR}/k3s" > /dev/null 2>&1; then
|
||||
$SUDO semanage fcontext -a -t bin_t "${BIN_DIR}/k3s"
|
||||
fi
|
||||
$SUDO restorecon -v ${BIN_DIR}/k3s > /dev/null
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
# --- download and verify k3s ---
|
||||
|
Loading…
Reference in New Issue
Block a user