Skip to content

Ensure overlay mounts create required directories#6870

Open
Ndukiye wants to merge 5 commits into
canonical:mainfrom
Ndukiye:cc-mounts-overlay-ensure-dirs
Open

Ensure overlay mounts create required directories#6870
Ndukiye wants to merge 5 commits into
canonical:mainfrom
Ndukiye:cc-mounts-overlay-ensure-dirs

Conversation

@Ndukiye

@Ndukiye Ndukiye commented May 6, 2026

Copy link
Copy Markdown
Contributor

Proposed Commit Message

fix(mounts): ensure overlay directories are created

Ensure required upper and work directories exist before overlay
mounts are applied. This prevents mount failures when directories
are missing during fstab processing.

Fixes #2916
LP: #1695277


## Additional Context
This change ensures cloud-init safely creates required directories
before attempting overlay filesystem mounts, improving robustness
on first boot scenarios.

## Test Steps
Run unit tests:
tox -e py3

Specifically:
pytest tests/unittests/config/test_cc_mounts.py -v

## Merge type

- [x] Squash merge using "Proposed Commit Message"
- [ ] Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

@Ndukiye

Ndukiye commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi, just following up on this PR. I’d appreciate any feedback or review when someone from the maintainers has time. Happy to make any changes needed.
Thanks!

Comment thread cloudinit/config/cc_mounts.py
@holmanb

holmanb commented Jul 14, 2026

Copy link
Copy Markdown
Member

@Ndukiye Do you plan to continue working on this?

@Ndukiye

Ndukiye commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@holmanb Yep! I addressed the feedback from your previous review by updating the documentation and pushed those changes a while ago. Since then I've just been waiting for another review. I'm happy to make any additional changes if you spot anything else.

@holmanb

holmanb commented Jul 16, 2026

Copy link
Copy Markdown
Member

Please address the failing CI jobs.

Ndukiye added 2 commits July 16, 2026 18:08
Remove trailing whitespace flagged by ruff (W293) and an unused
fake_fs fixture parameter in test_overlay_dirs_are_created.
@github-actions github-actions Bot added the documentation This Pull Request changes documentation label Jul 16, 2026
@Ndukiye

Ndukiye commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Done.
Fixed the lint issue (whitespace in my test). The unit test and labeler failures were already fixed on main (#6908, #6919), so I merged main to pick those up.

@Ndukiye
Ndukiye requested a review from holmanb July 21, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation This Pull Request changes documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cc_mounts should ensure_dir on lower, upper and workdir params

2 participants