From f72944530d01bda68eee6b3fdd0d98e02e5aa8aa Mon Sep 17 00:00:00 2001 From: Daniel Schmidt Date: Mon, 28 Jul 2025 09:11:14 +0200 Subject: [PATCH] add unknown as the first trigger event to account for serialization errors where the field is unset by mistake --- internal/configs/action.go | 3 ++- internal/configs/actiontriggerevent_string.go | 17 +++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/internal/configs/action.go b/internal/configs/action.go index 62460908f9..8524871f7b 100644 --- a/internal/configs/action.go +++ b/internal/configs/action.go @@ -65,7 +65,8 @@ type ActionTriggerEvent int //go:generate go tool golang.org/x/tools/cmd/stringer -type ActionTriggerEvent const ( - BeforeCreate ActionTriggerEvent = iota + Unkonwn ActionTriggerEvent = iota + BeforeCreate AfterCreate BeforeUpdate AfterUpdate diff --git a/internal/configs/actiontriggerevent_string.go b/internal/configs/actiontriggerevent_string.go index 67eba05a93..169a4e1eb2 100644 --- a/internal/configs/actiontriggerevent_string.go +++ b/internal/configs/actiontriggerevent_string.go @@ -8,17 +8,18 @@ func _() { // An "invalid array index" compiler error signifies that the constant values have changed. // Re-run the stringer command to generate them again. var x [1]struct{} - _ = x[BeforeCreate-0] - _ = x[AfterCreate-1] - _ = x[BeforeUpdate-2] - _ = x[AfterUpdate-3] - _ = x[BeforeDestroy-4] - _ = x[AfterDestroy-5] + _ = x[Unkonwn-0] + _ = x[BeforeCreate-1] + _ = x[AfterCreate-2] + _ = x[BeforeUpdate-3] + _ = x[AfterUpdate-4] + _ = x[BeforeDestroy-5] + _ = x[AfterDestroy-6] } -const _ActionTriggerEvent_name = "BeforeCreateAfterCreateBeforeUpdateAfterUpdateBeforeDestroyAfterDestroy" +const _ActionTriggerEvent_name = "UnkonwnBeforeCreateAfterCreateBeforeUpdateAfterUpdateBeforeDestroyAfterDestroy" -var _ActionTriggerEvent_index = [...]uint8{0, 12, 23, 35, 46, 59, 71} +var _ActionTriggerEvent_index = [...]uint8{0, 7, 19, 30, 42, 53, 66, 78} func (i ActionTriggerEvent) String() string { if i < 0 || i >= ActionTriggerEvent(len(_ActionTriggerEvent_index)-1) {