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

o/hookstate/ctlcmd: make is-connected check whether the plug or slot exists #9168

Merged

Conversation

jhenstridge
Copy link
Contributor

@jhenstridge jhenstridge commented Aug 17, 2020

Currently snapctl is-connected doesn't distinguish between non-existent plugs/slots and unconnected plugs/slots. This PR instead returns an error message for non-existent name. The exit code remains the same.

This makes typos in hooks and other scripts more obvious. It should not have any security implications, since a snap already knows what plugs and slots it has via $SNAP/meta/snap.yaml.

Copy link
Contributor

@mvo5 mvo5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jhenstridge
Copy link
Contributor Author

This fell out of some improvements I was doing to #9132, where I needed the snap.Info. It seemed easier to split this part out as it doesn't need the security review the rest of that PR would need.

@stolowski stolowski self-requested a review August 17, 2020 10:09
Copy link
Contributor

@stolowski stolowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thank you! One remark regarding comment.

overlord/hookstate/ctlcmd/is_connected.go Outdated Show resolved Hide resolved
@mvo5 mvo5 merged commit 87418d2 into canonical:master Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants