Use golang for the core snap configure hook


The configure hook for the `core’ snap is currently written n shell. This is not ideal as the code becomes harder and harder to maintain, the recent PR to add support for proxy settings to core config ( highlighted the problem once more.

After the unsuccessful proposal to port the code to python ( here is another proposal to port it to go (WIP branch:

The strawman proposal is:

  • add new /usr/lib/snapd/core-configure
  • once that has landed, change the core snap configure hook to just exec the above command

Alternatively instead of making it a separate command we could make it a (hidden) command in snapctl.

Weeks 24-29 of 2017 in snapd

I think it makes sense to have it as part of snapctl, as an implementation detail only as you point out (snapctl internal configure-core?). It saves space, avoids yet another command, and the context is appropriate: a lot of the things this tool will be doing depends on snapctl-based APIs.

Do you see any downsides on that which led you towards the independent command?


This has landed in master now.