From ce1867c2578a5c3f96c7adc8adec3a82ec2727e9 Mon Sep 17 00:00:00 2001 From: Tony Meyer Date: Tue, 9 Jul 2024 12:51:12 +1200 Subject: [PATCH] feat: add new hook types for the upcoming Pebble check events work See [OP046](https://docs.google.com/document/d/13ItH8l5ZSmmv9WqZXpqjV8EifZU5e3zxINiNLubnC68/edit). New hook names are: * `-pebble-check-failed` * `-pebble-check-recovered` --- hooks/hooks.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hooks/hooks.go b/hooks/hooks.go index 9d28fc8..4d1f606 100644 --- a/hooks/hooks.go +++ b/hooks/hooks.go @@ -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{ @@ -117,9 +118,10 @@ func StorageHooks() []Kind { } var workloadHooks = []Kind{ - PebbleChangeUpdated, PebbleCustomNotice, PebbleReady, + PebbleCheckFailed, + PebbleCheckRecovered, } // WorkloadHooks returns all known container hook kinds. @@ -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