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

snap/container.go: don't import snapdir, squashfs; use register format w/ init() #8727

Conversation

anonymouse64
Copy link
Member

Here we disentangle snap/container.go from importing snapdir and squashfs so that in a followup PR we can add an option struct to Install() that then is used in snapdir / squashfs implementations of Install().

We do this by having container.go export a register format function that is called during init() by the snapdir and squashfs packages. This required some refactoring to make snapdir work with a magic identifying function the way that squashfs currently does.

This is needed by #8711 so that I can add an InstallOptions to Install() and use it to enforce that we don't ever create symlinks in some situations (like in run mode on uc20).

…t w/ init()

Here we disentangle snap/container.go from importing snapdir and squashfs so
that in a followup PR we can add an option struct to Install() that then is used
in snapdir / squashfs implementations of Install().

We do this by having container.go export a register format function that is
called during init() by the snapdir and squashfs packages. This required some
refactoring to make snapdir work with a magic identifying function the way that
squashfs currently does.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
@pedronis
Copy link
Collaborator

this would require all real users of snap.Open to also import snap/squashfs and snap/snapdir on their own, this is a bit too annoying for this particular case. we need to find another path forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants