-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for Pebble check-failed and check-recovered events (#…
…1281) Two new event types are supported (actually getting these events requires Juju 3.6b2 or higher): * `PebbleChangeFailedEvent` - emitted when a Pebble check in a container hits the failure threshold * `PebbleChangeRecoveredEvent` - emitted when a Pebble check in a container passes after previously hitting the failure threshold Each event type has a single new attribute (in addition to those inherited from `WorkloadEvent`): * `info` - this is a shortcut to Pebble's `get_check` method (not otherwise accessible from the charm), but will only query Pebble if more than the `name` is requested, and will cache the result on the event instance. Two new enums are added to Pebble, to make it easier to work with these events, particularly with Harness: * `ChangeStatus` - the possible values for `ops.pebble.Change.status` (note that this is the full list, but we only expect charms to see Doing, Done, and Error for now). * `ChangeKind` - the possible values for `ops.pebble.Change.kind` (again, this is the current full list, but we only expect charms to see perform-check and recover-check at the moment). `Harness.pebble_notify` is extended to support emitting the two new events. This requires implementation knowledge (that the check events are triggered by a Pebble notice of type change-updated), but provides minimal support for testing with Harness, and will be supplemented by user-friendly testing in Scenario. The testing Pebble backend gains an implementation for `get_change` and `get_checks`. These are not used directly here, but will be used in Scenario, and it makes more sense to have the implementation in ops. This is the ops portion of [OP046](https://docs.google.com/document/d/13ItH8l5ZSmmv9WqZXpqjV8EifZU5e3zxINiNLubnC68/edit). It requires a [corresponding change to Pebble](canonical/pebble#444) and [change to Juju](juju/juju#17655).
- Loading branch information
1 parent
5a21cd2
commit e3eae86
Showing
10 changed files
with
360 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.