Skip to content

Restructure (3): Hide state directory utils behind interface#553

Merged
roosterfish merged 8 commits intocanonical:v3from
roosterfish:hide_os
Dec 3, 2025
Merged

Restructure (3): Hide state directory utils behind interface#553
roosterfish merged 8 commits intocanonical:v3from
roosterfish:hide_os

Conversation

@roosterfish
Copy link
Contributor

This is the third PR taken from a single commit in #534.
The final package layout will be different but to allow reviewing the changes in smaller chunks I will split this PR by its commits.

In this PR the state directory utils (internal sys package) are not anymore returned directly from the state but are now hidden behind a common OS interface inside microcluster/types package. As the state is exposed to API handlers written by downstream users, this allows proper mocking.

We should expose this to allow easy access to the daemon's config and certificates where necessary.

This allows keeping the state directory tooling internally but allow mocking the it for unit tests
as it's exported as part of the state available for API handlers written by downstream consumers of Microcluster.

Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
Signed-off-by: Julian Pelizäus <julian.pelizaeus@canonical.com>
@roosterfish roosterfish marked this pull request as ready for review December 2, 2025 17:21
@roosterfish roosterfish merged commit 25ea54c into canonical:v3 Dec 3, 2025
5 checks passed
@roosterfish roosterfish deleted the hide_os branch December 3, 2025 07:53
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.

2 participants