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: support change-update notice and pebble-change-updated event #1170
Conversation
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.
Looks great to me, thanks!
CUSTOM = 'custom' | ||
"""A custom notice reported via the Pebble client API or ``pebble notify``. | ||
The key and data fields are provided by the user. The key must be in | ||
the format ``example.com/path`` to ensure well-namespaced notice keys. |
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.
Do we validate this?
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.
Yeah, we validate it (in the Pebble server), so the workload will get an error if it tries to add a custom notice (pebble notify
) with an invalid key. The API does "reasonable effort" validation with a regex.
…event (canonical#1170)" This reverts commit b7e5ba3.
) This reverts #1170 (commit b7e5ba3) as this feature has been reverted in Juju on the 3.5 branch, due to the issues described at this PR: juju/juju#17191
This adds support for the new
pebble-change-updated
event (Juju PR juju/juju#17118), adding a newPebbleChangeUpdatedEvent
type and{container_name}_pebble_change_updated
event you can observe.The event has a
get_change()
method to easily fetch the associatedpebble.Change
object.It also adds
Harness.pebble_notify
support for thepebble.NoticeType.CHANGE_UPDATE
notice type. To use that, you say: