Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PATH to k3s env in install script #11096

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,7 @@ create_env_file() {
$SUDO chmod 0600 ${FILE_K3S_ENV}
sh -c export | while read x v; do echo $v; done | grep -E '^(K3S|CONTAINERD)_' | $SUDO tee ${FILE_K3S_ENV} >/dev/null
sh -c export | while read x v; do echo $v; done | grep -Ei '^(NO|HTTP|HTTPS)_PROXY' | $SUDO tee -a ${FILE_K3S_ENV} >/dev/null
sh -c export | while read x v; do echo $v; done | grep -E 'PATH' | sed "s/'//g" | $SUDO tee -a ${FILE_K3S_ENV} >/dev/null
Copy link
Member

@brandond brandond Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we adding the user’s PATH to the systemd unit’s PATH?

Generally system services have a path that is intentionally more restricted than user paths. It is not really a best practice to add random untrusted paths to the service. If users have non-standard paths in their environment that they want K3s to use I think they should have to add these manually, I would not like to just grab whatever the user has in their env when they run the installer.

}

# --- write systemd service file ---
Expand Down