Skip to content

Commit

Permalink
Fix: Add $SUDO prefix to transactional-update commands in install script
Browse files Browse the repository at this point in the history
This commit addresses an issue in the k3s install script where the transactional-update commands did not include the $SUDO variable. This omission caused the script to fail if sudo was not used. Adding the $SUDO prefix ensures that the script runs correctly in all environments.

Signed-off-by: ChrisBeaker <[email protected]>
Signed-off-by: Derek Nola <[email protected]>
  • Loading branch information
ChrisBeaker authored and dereknola committed Aug 12, 2024
1 parent ac247d2 commit f3808e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ EOF
: "${INSTALL_K3S_SKIP_START:=true}"
fi
# create the /var/lib/rpm-state in SLE systems to fix the prein selinux macro
${transactional_update_run} mkdir -p /var/lib/rpm-state
$SUDO ${transactional_update_run} mkdir -p /var/lib/rpm-state
;;
coreos)
rpm_installer="rpm-ostree --idempotent"
Expand Down Expand Up @@ -941,7 +941,7 @@ elif type zypper >/dev/null 2>&1; then
if [ "\${TRANSACTIONAL_UPDATE=false}" != "true" ] && [ -x /usr/sbin/transactional-update ]; then
uninstall_cmd="transactional-update --no-selfupdate -d run \$uninstall_cmd"
fi
\$uninstall_cmd
$SUDO \$uninstall_cmd
rm -f /etc/zypp/repos.d/rancher-k3s-common*.repo
fi
EOF
Expand Down

0 comments on commit f3808e0

Please sign in to comment.