canonical / operator-libs-linux

Linux helper libraries for the operator framework
Apache License 2.0
11 stars 39 forks source link

feat(snap): add support for devmode confinement #117

Closed gruyaume closed 8 months ago

gruyaume commented 9 months ago

Snaps have 3 confinement levels: strict, classic and devmode. devmode snaps are useful during the development process. Here we add support for installing snaps with the devmode level of confinement.

Rationale

The first reason to add support for devmode is by symmetry with snaps/snapcraft. devmode is supported by snapcraft.io, why not support it here?

The second reason is pragmatic. The telco team has the SD-Core UPF charm which is only available in devmode. Adding strict confinement for this charm won't be straightforward but we don't want to go through the "classic" review process until we really had a try with strict confinement for it. Until then it will only be available in devmode and we need a way to move ahead with the machine charm.

gruyaume commented 9 months ago

@benhoyt as for the remark related to the integration tests, I could add a test that installs the sdcore-upf snap (which is only available in devmode), however I'm not convinced this is a great idea as the goal at some point will be to have it available as a strictly confined snap and remove devmode confinement (which will break this existing project). Do you have a suggestion here?

benhoyt commented 8 months ago

To speed things up, I've merged this pre-emptively -- if you find anything wonky in your manual testing, we can push up another PR.