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

Fix deletion of persistent data with k0s reset #5193

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Commits on Nov 8, 2024

  1. Fix deletion of data and kube root dirs

    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]>
    ncopa committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    7ab81aa View commit details
    Browse the repository at this point in the history
  2. Augment k0s reset integration tests

    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]>
    twz123 authored and ncopa committed Nov 8, 2024
    Configuration menu
    Copy the full SHA
    2897c35 View commit details
    Browse the repository at this point in the history