Skip to content

Conversation

@dockerpac
Copy link

@dockerpac dockerpac commented Oct 3, 2025

Description

Fixes an issue where k0s reset was unmounting and deleting the kubelet-root-dir mount point when configured on a separate filesystem.

When --kubelet-root-dir is on a dedicated partition (common in production), k0s reset would unmount the filesystem and delete the mount point.

This PR applies the same mount point preservation logic to kubelet-root-dir that was already existing for data-dir.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

How Has This Been Tested?

  • Manual test
  • Auto test added

Tested scenarios:

  • Mounted filesystem: Kubelet mount point preserved, only contents deleted
  • Default setup: Directory completely removed as before

Checklist

  • My code follows the style guidelines of this project
  • My commit messages are signed-off
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have checked my code and corrected any misspellings

Signed-off-by: Pierre-Antoine Couaillier <[email protected]>
@dockerpac dockerpac marked this pull request as ready for review October 3, 2025 17:52
@dockerpac dockerpac requested review from a team as code owners October 3, 2025 17:52
@dockerpac dockerpac requested review from makhov and twz123 October 3, 2025 17:52
@jnummelin
Copy link
Member

@ncopa You were involved designing the data-dir reset/unmount logic, could you review this? 🙏

@ncopa
Copy link
Collaborator

ncopa commented Oct 23, 2025

The make check-reset test fails:

        	Test:       	TestResetSuite/TestReset/k0s_reset
        	Messages:   	/var/lib/kubelet still exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants