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

[Backport release-1.29] Fix deletion of persistent data with k0s reset #5346

Merged
merged 3 commits into from
Dec 12, 2024

Conversation

ncopa and others added 3 commits December 11, 2024 10:59
Make sure that we don't have anything mounted under those directories so
we don't delete persistent data.

We do this py parsing /proc/mounts in reverse order as it is listed in
mount order, and then we unmount anything that is under our directories
before we delete them.

Don't umount datadir itself if it is on a separate partition/mount

Fixes k0sproject#4318

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 7ab81aa)
(cherry picked from commit 54fb78c)
Add a script to the reset integration test that tries to clutter the
data directory by placing files and directories with odd permissions,
adding symlinks to stuff outside the data directory, and adding bind
mounts in various ways.

This is to prove that k0's reset will never delete anything that is not
beneath the data directory.

Signed-off-by: Tom Wieczorek <[email protected]>
(cherry picked from commit 2897c35)
(cherry picked from commit aeea4ff)
k0s reset will delete any leftovers safely when deleting directories.

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 12aa906)
(cherry picked from commit 62de5e6)
@twz123 twz123 added the bug Something isn't working label Dec 11, 2024
@twz123 twz123 marked this pull request as ready for review December 11, 2024 13:11
@twz123 twz123 requested a review from a team as a code owner December 11, 2024 13:11
@twz123 twz123 requested review from ncopa and jnummelin December 11, 2024 13:11
@twz123 twz123 merged commit 9088f42 into k0sproject:release-1.29 Dec 12, 2024
82 checks passed
@twz123 twz123 deleted the backport-5300-to-release-1.29 branch December 12, 2024 18:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants