From c184c96b14c91764b30409b7398a1db9bc00a355 Mon Sep 17 00:00:00 2001 From: Ben Hoyt Date: Fri, 22 Sep 2023 16:10:21 +1200 Subject: [PATCH 1/3] Add new hook types for Pebble Notices (JU048) --- hooks/hooks.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hooks/hooks.go b/hooks/hooks.go index 24a77f0..ec05b42 100644 --- a/hooks/hooks.go +++ b/hooks/hooks.go @@ -60,7 +60,9 @@ const ( // kinds represent will be prefixed by the workload/container name; for example, // "mycontainer-pebble-ready". - PebbleReady Kind = "pebble-ready" + PebbleChangeUpdate Kind = "pebble-change-update" + PebbleClient Kind = "pebble-client" + PebbleReady Kind = "pebble-ready" ) var unitHooks = []Kind{ @@ -115,6 +117,8 @@ func StorageHooks() []Kind { } var workloadHooks = []Kind{ + PebbleChangeUpdate, + PebbleClient, PebbleReady, } @@ -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 PebbleChangeUpdate, PebbleClient, PebbleReady: return true } return false From 7151edf38197dfea8dbb237dfaefd166159c39d6 Mon Sep 17 00:00:00 2001 From: Ben Hoyt Date: Mon, 25 Sep 2023 15:41:20 +1300 Subject: [PATCH 2/3] Rename hook names to pebble-change-updated, pebble-client-notice --- hooks/hooks.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hooks/hooks.go b/hooks/hooks.go index ec05b42..6f84fcc 100644 --- a/hooks/hooks.go +++ b/hooks/hooks.go @@ -60,9 +60,9 @@ const ( // kinds represent will be prefixed by the workload/container name; for example, // "mycontainer-pebble-ready". - PebbleChangeUpdate Kind = "pebble-change-update" - PebbleClient Kind = "pebble-client" - PebbleReady Kind = "pebble-ready" + PebbleChangeUpdated Kind = "pebble-change-updated" + PebbleClientNotice Kind = "pebble-client-notice" + PebbleReady Kind = "pebble-ready" ) var unitHooks = []Kind{ @@ -117,8 +117,8 @@ func StorageHooks() []Kind { } var workloadHooks = []Kind{ - PebbleChangeUpdate, - PebbleClient, + PebbleChangeUpdated, + PebbleClientNotice, PebbleReady, } @@ -150,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 PebbleChangeUpdate, PebbleClient, PebbleReady: + case PebbleChangeUpdated, PebbleClientNotice, PebbleReady: return true } return false From b435ae57406c0b0a8c44e293efee701a5ca12b64 Mon Sep 17 00:00:00 2001 From: Ben Hoyt Date: Tue, 3 Oct 2023 16:52:41 +1300 Subject: [PATCH 3/3] Update hook name per spec review --- hooks/hooks.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hooks/hooks.go b/hooks/hooks.go index 6f84fcc..9d28fc8 100644 --- a/hooks/hooks.go +++ b/hooks/hooks.go @@ -61,7 +61,7 @@ const ( // "mycontainer-pebble-ready". PebbleChangeUpdated Kind = "pebble-change-updated" - PebbleClientNotice Kind = "pebble-client-notice" + PebbleCustomNotice Kind = "pebble-custom-notice" PebbleReady Kind = "pebble-ready" ) @@ -118,7 +118,7 @@ func StorageHooks() []Kind { var workloadHooks = []Kind{ PebbleChangeUpdated, - PebbleClientNotice, + PebbleCustomNotice, PebbleReady, } @@ -150,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 PebbleChangeUpdated, PebbleClientNotice, PebbleReady: + case PebbleChangeUpdated, PebbleCustomNotice, PebbleReady: return true } return false