Skip to content

Commit

Permalink
Merge pull request #419 from benhoyt/pebble-notices-hooks
Browse files Browse the repository at this point in the history
#419

Add new hook types for the upcoming Pebble Notices work. See ["Juju and charms" section in JU048](https://docs.google.com/document/d/16PJ85fefalQd7JbWSxkRWn0Ye-Hs8S1yE99eW7pk8fA/edit#heading=h.mpgnfy965ixr), the Pebble Notices spec. New hook names are:

* `<container>-pebble-custom-notice`
* `<container>-pebble-change-updated`
  • Loading branch information
jujubot committed Oct 3, 2023
2 parents 2d7f058 + b435ae5 commit 9331b9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hooks/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ const (
// kinds represent will be prefixed by the workload/container name; for example,
// "mycontainer-pebble-ready".

PebbleReady Kind = "pebble-ready"
PebbleChangeUpdated Kind = "pebble-change-updated"
PebbleCustomNotice Kind = "pebble-custom-notice"
PebbleReady Kind = "pebble-ready"
)

var unitHooks = []Kind{
Expand Down Expand Up @@ -115,6 +117,8 @@ func StorageHooks() []Kind {
}

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

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

0 comments on commit 9331b9c

Please sign in to comment.