Repository navigation
o/hookstate/ctlcmd: add a new exit code for is-connected for cases when the peer is from the same snap - #10024
Closed
jhenstridge wants to merge 3 commits into
Closed
jhenstridge wants to merge 3 commits into
jhenstridge wants to merge 3 commits into
Conversation
stolowski
approved these changes
Mar 10, 2021
stolowski
left a comment
Contributor
There was a problem hiding this comment.
Looks good, thank you!
pedronis
self-requested a review
March 10, 2021 13:20
Contributor
|
as discussed, self-connections are not fully unusual, if a snap ships both the server side of a service and client tool, it's possibly a better pattern for the slot permissions to be given only to the services that constitute the server side, in which case the client applications might need a self-connection anyway to talk to the server bits. This code here helps when not doing this, so until there's a clearer use case I would prefer not to go into this direction. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR grew out of discussions about the CUPS snap on the forum:
https://forum.snapcraft.io/t/request-cups-snap-cups-auto-connection-to-of-cups-cups-control-to-cups-admin-and-also-of-the-network-manager-observe-interface/22802/25?u=jamesh
At present, Till's CUPS snap has both a plug and slot for the
cups-controlinterface, with a request that they be auto-connected. At present the plug is not actually necessary to connect to the CUPS socket (that permission comes with the slot), but is needed to verify that utilities like lpadmin to pass thesnapctl is-connectedcheck.As discussed in the forum thread, we could avoid the need for the extra plug if
snapctl is-connectedgrew a new exit code representing "peer is not connected, but belongs to the same snap". So that is what this PR implements.