From b4defe0d7a94f39ceb9bf420f8f52bcbdc6c91a6 Mon Sep 17 00:00:00 2001 From: Galo Navarro Date: Sat, 11 Nov 2023 07:53:02 +0100 Subject: [PATCH] Fix config parser for appendOnly The struct needed an explicit `yaml:"appendOnly"` as camel case is not the default. Signed-off-by: Galo Navarro --- pkg/labeler.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/labeler.go b/pkg/labeler.go index 38c07e9..1339033 100644 --- a/pkg/labeler.go +++ b/pkg/labeler.go @@ -46,7 +46,7 @@ type LabelerConfigV1 struct { // When set to true, we will only add labels when they match a rule // but it will NOT remove labels that were previously set and stop // matching a rule - AppendOnly bool + AppendOnly bool `yaml:"appendOnly"` Labels []LabelMatcher } @@ -169,6 +169,11 @@ func (l *Labeler) ExecuteOn(target *Target) error { intentions[label] = true } + log.Printf("Current labels: `%v`", intentions) + if config.AppendOnly { + log.Printf("AppendOnly is active, removals are forbidden") + } + log.Printf("Preliminary label updates: `%v`", labelUpdates) // update, adding new ones and unflagging those to remove if // necessary for label, isDesired := range labelUpdates.set {