Skip to content

Commit

Permalink
Merge pull request #432 from tonyandrewmeyer/pebble-check-hooks
Browse files Browse the repository at this point in the history
feat: Add new hook types for Pebble check events (OP046)
  • Loading branch information
hpidcock authored Jul 9, 2024
2 parents 22e0a93 + ce1867c commit c09ff56
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ const (
// kinds represent will be prefixed by the workload/container name; for example,
// "mycontainer-pebble-ready".

PebbleChangeUpdated Kind = "pebble-change-updated"
PebbleCustomNotice Kind = "pebble-custom-notice"
PebbleReady Kind = "pebble-ready"
PebbleCustomNotice Kind = "pebble-custom-notice"
PebbleReady Kind = "pebble-ready"
PebbleCheckFailed Kind = "pebble-check-failed"
PebbleCheckRecovered Kind = "pebble-check-recovered"
)

var unitHooks = []Kind{
Expand Down Expand Up @@ -117,9 +118,10 @@ func StorageHooks() []Kind {
}

var workloadHooks = []Kind{
PebbleChangeUpdated,
PebbleCustomNotice,
PebbleReady,
PebbleCheckFailed,
PebbleCheckRecovered,
}

// WorkloadHooks returns all known container hook kinds.
Expand Down Expand Up @@ -150,7 +152,7 @@ func (kind Kind) IsStorage() bool {
// IsWorkload returns whether the Kind represents a workload hook.
func (kind Kind) IsWorkload() bool {
switch kind {
case PebbleChangeUpdated, PebbleCustomNotice, PebbleReady:
case PebbleCustomNotice, PebbleReady, PebbleCheckFailed, PebbleCheckRecovered:
return true
}
return false
Expand Down

0 comments on commit c09ff56

Please sign in to comment.