-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: Pebble Notices #20
Conversation
6a277f6
to
eff68d6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 small nitpicks, otherwise LGTM
Co-authored-by: Ghislain Bourgeois <[email protected]>
Co-authored-by: Ghislain Bourgeois <[email protected]>
What if there was an error and we couldn't send a pebble notification for this specific certificate to the charm? would the charm still be able to get it later somehow? or will the charm miss that change? |
Any error that may occur with pebble is simply out of our control, we provide a rock with pebble guaranteed to be installed. So if any error were to occur, the cause would be pebble/charm specific or container image specific. If you mean intermittent runtime errors, pebble notifications not working would mean pebble is broken. This would break a lot of things with charms, like replans and restarts or any container interactions. In this case GoCert notices are just as reliable as the infrastructure that supports it, and there's not much we could do about that. So yes, long story short charms will miss that event. |
Co-authored-by: Guillaume Belanger <[email protected]>
Co-authored-by: Guillaume Belanger <[email protected]>
Description
This change introduces pebble notices to the GoCert's backend as included in spec TE034. It is enabled in the configuration file. Each update to a CSR's related certificate will create a new pebble notice, which will allow the charm to listen to changes in GoCert and make relevant changes to the charm relations.
The test for this feature is inside of build_rock.yaml. This is both because testing the execution of external commands is difficult without mocking, and to make sure that there is no doubt that pebble is actually receiving the request in a regular rock deployment.
$ docker exec gocert /usr/bin/pebble notices
$ <submit CSR through curl>
stdout:
stderr:
1
$ <submit certificate through curl>
stdout:
stderr:
1
$ docker exec gocert /usr/bin/pebble notices
When the pebble binary is missing or any other error is produced, an error is logged, but if the change was successfully committed to the database, the GoCert application does not roll back the changes and responds to the HTTP request regularly. This is to support deployments outside of the Rock or any custom containers without pebble installed. It's also not preferable for users to go through the effort of uploading a cert, get everything right, then get rejected for something that's out of their control.
Checklist: