Skip to content

Commit

Permalink
refactor: change order of bin install
Browse files Browse the repository at this point in the history
  • Loading branch information
jobcespedes committed Aug 9, 2024
1 parent 0c6e94b commit ae92d88
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions conf/prepare.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,6 @@ curl -sfL "${K3S_SCRIPT_URL}" -o "${K3S_SCRIPT_FILE}"
chmod 0700 "${K3S_SCRIPT_FILE}"
chown root:root -R "${INSTALL_K3S_BIN_DIR}"

# Install k3s binary
source <(sed 's/^set -e/#set -e/; /include env command/q' "${K3S_SCRIPT_FILE}")
{
set +ue
verify_system
setup_env "$@"
download_and_verify
}

# Install k3s-selinux
case ${INSTALL_K3S_CHANNEL} in
*testing) rpm_channel=testing ;;
Expand All @@ -46,11 +37,23 @@ gpgcheck=1
repo_gpgcheck=0
gpgkey=https://${rpm_site}/public.key
_EOF
rpm-ostree install -y k3s-selinux

rpm-ostree install --idempotent --allow-inactive --apply-live --assumeyes container-selinux k3s-selinux

# Install k3s binary
source <(sed 's/^set -e/#set -e/; /include env command/q' "${K3S_SCRIPT_FILE}")
{
set +ue
verify_system
setup_env "$@"
download_and_verify
}

# Create necessary directories and set correct SELinux context
mkdir -p "/var/lib/rancher/k3s"
restorecon -R "/var/lib/rancher/k3s"
# TODO: add container_runtime_exec_t to "${INSTALL_K3S_BIN_DIR}/k3s" binary
# chcon -u system_u -r object_r -t container_runtime_exec_t "${INSTALL_K3S_BIN_DIR}/k3s"

# Clean up RPM-OSTree and commit the changes
rpm-ostree cleanup -m
Expand Down

0 comments on commit ae92d88

Please sign in to comment.