k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
28.02k stars 2.35k forks source link

Install script fails without sudo due to missing $SUDO prefix in transactional-update commands #10530

Closed ChrisBeaker closed 1 month ago

ChrisBeaker commented 3 months ago

Environmental Info: K3s Version: none, install.sh is affected

Node(s) CPU architecture, OS, and Version: n/a

Cluster Configuration: n/a

Describe the bug: The k3s install script fails when executed as non-root user, because the transactional-update commands do not prefix the $SUDO variable. This causes issues in environments where sudo is required.

Steps To Reproduce: Run k3s install.sh script as non-root user on systems where transactional-update is needed. (e.g. SUSE Linux Micro 6.0)

  curl -sfL https://get.k3s.io/ | sh -

Expected behavior: Installation succeeds without issues.

Actual behavior: Installation fails:

+ transactional-update --no-selfupdate -d run mkdir -p /var/lib/rpm-state
main: line 670: transactional-update: command not found

Additional context / logs: PR prepared, see below

github-actions[bot] commented 2 months ago

This repository uses a bot to automatically label issues which have not had any activity (commit/comment/label) for 45 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the bot can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the bot will automatically close the issue in 14 days. Thank you for your contributions.