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

K3S_DATA_DIR is lost when running kill and uninstall scripts as non-root user #11386

Open
unguiculus opened this issue Nov 28, 2024 · 0 comments · May be fixed by #11378
Open

K3S_DATA_DIR is lost when running kill and uninstall scripts as non-root user #11386

unguiculus opened this issue Nov 28, 2024 · 0 comments · May be fixed by #11378

Comments

@unguiculus
Copy link
Contributor

unguiculus commented Nov 28, 2024

Environmental Info:
K3s Version:
v1.31.2+k3s1

Node(s) CPU architecture, OS, and Version:
Any. Not relevant.

Cluster Configuration:
Various configurations. Not relevant.

Describe the bug:
The generated k3s-killall.sh and k3s-uninstall.sh scripts replace the current process with the same but running with sudo. This does not preserve the environment, i.e. a custom data directory using K3S_DATA_DIR is ignored.

Steps To Reproduce:

  • Open a shell as non-root user
  • Export environment variable K3S_DATA_DIR=$HOME/mydata
  • Create a cluster in the same shell
  • Run k3s-uninstall.sh in the same shell

Expected behavior:
Uninstallation should work properly. $K3S_DATA_DIR should be cleaned.

Actual behavior:
Instead of $K3S_DATA_DIR, /var/lib/rancher/k3s is used. $K3S_DATA_DIR is not cleaned. K3s is not properly uninstalled. This can be seen in the logs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: New
Development

Successfully merging a pull request may close this issue.

1 participant