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.30] Fix deletion of persistent data with k0s reset #5300

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

k0s-bot
Copy link

@k0s-bot k0s-bot commented Nov 29, 2024

Automated backport to release-1.30, triggered by a label in #5193.
See #4318.

ncopa and others added 3 commits November 29, 2024 12:08
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 #4318

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 7ab81aa)
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)
k0s reset will delete any leftovers safely when deleting directories.

Signed-off-by: Natanael Copa <[email protected]>
(cherry picked from commit 12aa906)
@k0s-bot k0s-bot requested a review from a team as a code owner November 29, 2024 12:08
@k0s-bot k0s-bot requested review from ncopa and jnummelin November 29, 2024 12:08
@twz123 twz123 merged commit b1634f0 into release-1.30 Dec 9, 2024
82 checks passed
@twz123 twz123 deleted the backport-5193-to-release-1.30 branch December 9, 2024 10:18
@twz123 twz123 added bug Something isn't working backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch labels Dec 10, 2024
@k0s-bot
Copy link
Author

k0s-bot commented Dec 10, 2024

Backport failed for release-1.29, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.29
git worktree add -d .worktree/backport-5300-to-release-1.29 origin/release-1.29
cd .worktree/backport-5300-to-release-1.29
git switch --create backport-5300-to-release-1.29
git cherry-pick -x 54fb78c8cf905103d6aed93df1b56a231229e052 aeea4ff58c9fcd9eebca14d730f092c315bb64b6 62de5e649d151e55f1ed54d4c3f71ceedd47d3a2

@twz123 twz123 mentioned this pull request Dec 11, 2024
16 tasks
@twz123 twz123 removed the backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch label Dec 11, 2024
@twz123 twz123 added the backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch label Dec 11, 2024
@k0s-bot
Copy link
Author

k0s-bot commented Dec 11, 2024

Backport failed for release-1.29, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-1.29
git worktree add -d .worktree/backport-5300-to-release-1.29 origin/release-1.29
cd .worktree/backport-5300-to-release-1.29
git switch --create backport-5300-to-release-1.29
git cherry-pick -x 54fb78c8cf905103d6aed93df1b56a231229e052 aeea4ff58c9fcd9eebca14d730f092c315bb64b6 62de5e649d151e55f1ed54d4c3f71ceedd47d3a2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/release-1.29 PR that needs to be backported/cherrypicked to the release-1.29 branch bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants