-
Notifications
You must be signed in to change notification settings - Fork 266
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
Uninstall handle cases when directories are mounts and cannot be removed #4470
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the PR!
Why instead of fixing the root cause, this PR is just ignoring the issue? Logs:
Directory /var/lib/kubelet is not removed and automation script didn't catch the error as the rke2-uninstall.sh script completed. |
Hello @andrewkhalaf, you can check out where our QA has validated that this issue is fixed here. If you follow the same reproduction steps and still see problems, please open a new bug report or feature request. Thanks! |
@andrewkhalaf the umount of those paths should have been handled by the rke2-killall script, prior to the uninstall script trying to delete the directory. Unfortunately you've not included the portion of the log where the killall script was run, so I can't say why it didn't work. |
Proposed Changes
In some cases a machine is configured with
/var/lib/kubelet
as a mount rather than a directory and this causes therke2-uninstall.sh
script to fail where it is removing directories so the machine isn't fully cleaned up. If you use the Rancher Federal Ansible RKE2 installer to install/re-instal RKE2, the presence of the files causes a re-install to fail. The change in this PR accomplishes exactly the same thing as the code it replaces becauserm -rf
removes all files under a directory before trying to remove the directory itself. In the case where/var/lib/kubelet
is a mount, it just ignores the error and moves on to clean up/var/lib/rancher
.Verification
In AWS, provision an instance with two drives and configure
/var/lib/kubelet
as a mount:Then install rke2 and uninstall using the modified script. Confirm the script exits without error and
/var/lib/rancher
is removed.Linked issue:
/var/lib/kubelet
is a mount point #4475