Hello
I work at EFF and am trying to understand something about the Certbot snaps we recently created.
In the base Certbot snap, we define a content interface plug like:
plugs:
plugin:
interface: content
content: certbot-1
target: $SNAP/certbot-plugin
We then created many additional snaps for features one can add to Certbot (such as certbot-dns-cloudflare) which defines the slot for this interface like:
slots:
certbot:
interface: content
content: certbot-1
read:
- $SNAP/lib/python3.8/site-packages
In case it is useful, the full snapcraft.yml
files for these snaps are here and here respectively.
Once publishing these snaps to the snap store, we were surprised to find that when you install multiple snaps that have slots for the plug in the base Certbot snap, only the first auto-connects. For instance:
$ sudo snap install --edge --classic certbot
certbot (edge) 1.6.0-21-g086c8b1b3 from Certbot Project (certbot-effâś“) installed
$ sudo snap set certbot trust-plugin-with-root=ok
$ sudo snap install --edge certbot-dns-luadns
certbot-dns-luadns (edge) 1.7.0.dev0 from Certbot Project (certbot-effâś“) installed
$ sudo snap set certbot trust-plugin-with-root=ok
$ sudo snap install --edge certbot-dns-digitalocean
certbot-dns-digitalocean (edge) 1.7.0.dev0 from Certbot Project (certbot-effâś“) installed
$ sudo snap connections
Interface Plug Slot Notes
content[certbot-1] certbot:plugin certbot-dns-luadns:certbot -
(The command sudo snap set certbot trust-plugin-with-root=ok
is needed for the prepare-plug-plugin
hook in base Certbot snap to allow the slot to connect which is an implementation detail discussed at Certbot: request for classic snap approval - #19 by jdstrand if you’re curious.)
My question is is it expected behavior for only the first slot to auto-connect? The best documentation I could find about this is Plug/slot declaration rules: greedy plugs, but I didn’t fully understand the post.
Is it possible to change this behavior and how do we go about doing so? Is it something we’d need to open a store-requests post about? Is the only implication of that change in our case that all slots for this interface also published by us will auto-connect like we initially anticipated?
Thanks for any help clarifying my understanding here!