-
Notifications
You must be signed in to change notification settings - Fork 8
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: add support for Pebble check events #151
Merged
tonyandrewmeyer
merged 13 commits into
canonical:7.0
from
tonyandrewmeyer:add-pebble-check-events
Jul 24, 2024
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
51ec551
Add support for Pebble checks.
tonyandrewmeyer 9a5b350
Use canonical/operator, not the branch.
tonyandrewmeyer 3b4224f
Add a test for the new consistency check.
tonyandrewmeyer e746e9b
Merge branch '7.0' into add-pebble-check-events
tonyandrewmeyer fb4fc17
Use the same name as ops, per review.
tonyandrewmeyer 3c906f0
Ensure the event is called, per review.
tonyandrewmeyer 5cdbdd3
Swap back to regular ops.
tonyandrewmeyer d0c4d35
Align names, per review.
tonyandrewmeyer 1ff298a
Rename Container.checks to Container.check_infos.
tonyandrewmeyer 0c160d5
Add extra test for multiple containers.
tonyandrewmeyer e5e454c
Strengthen the consistency check: the Check must be in the correct Co…
tonyandrewmeyer f718af0
Merge branch '7.0' into add-pebble-check-events
tonyandrewmeyer 3df6a28
Add lost @staticmethod (from merge).
tonyandrewmeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.
Oops, something went wrong.
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.
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.
I wonder if the defaults should be reversed here, to CheckStatus.DOWN and e.g. failures=3. The normal situation should be that the check is passing, but if it's passing then I doubt people would be creating the event and putting it into the container (if that was done automatically with a tool, then it would not require the defaults).
I think observing and therefore testing pebble-check-failed is probably more likely than pebble-check-recovered, so that would lean me towards making a failing check the one that requires the least work. Or maybe charms will always observe both, in a kind of do/undo pattern?
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.
I think what you have (UP, 0) is better, as it matches the Pebble "defaults". So it seems more explicit and less surprising to me than having it (DOWN, 3) as a default, even if it's a bit more work for tests that use it.