From 0a40f12942215b53062c3b0172b61a856aa6c1dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCnemann?= Date: Thu, 6 Nov 2025 16:37:49 +0100 Subject: [PATCH 1/3] fix: remove the preprending and appendig to condition type and reason --- pkg/conditions/updater.go | 20 +++----------------- pkg/controller/status_updater_test.go | 6 +++--- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/pkg/conditions/updater.go b/pkg/conditions/updater.go index a7d5afa..a22e8a6 100644 --- a/pkg/conditions/updater.go +++ b/pkg/conditions/updater.go @@ -290,7 +290,8 @@ func ReplaceIllegalCharsInConditionType(s string) string { result = append(result, '_') } } - return ensureStartsAndEndsWithLetter(string(result), 'T', 't') + + return string(result) } // ReplaceIllegalCharsInConditionReason replaces all characters in the given string that are not allowed in condition reasons with underscores. @@ -320,21 +321,6 @@ func ReplaceIllegalCharsInConditionReason(s string) string { result = append(result, '_') } } - return ensureStartsAndEndsWithLetter(string(result), 'R', 'r') -} -func ensureStartsAndEndsWithLetter(s string, start, end rune) string { - if s == "" { - return s - } - runes := []rune(s) - // Ensure starts with letter - if (runes[0] < 'a' || runes[0] > 'z') && (runes[0] < 'A' || runes[0] > 'Z') { - runes = append([]rune{start}, runes...) - } - // Ensure ends with letter - if (runes[len(runes)-1] < 'a' || runes[len(runes)-1] > 'z') && (runes[len(runes)-1] < 'A' || runes[len(runes)-1] > 'Z') { - runes = append(runes, end) - } - return string(runes) + return string(result) } diff --git a/pkg/controller/status_updater_test.go b/pkg/controller/status_updater_test.go index 4b9e43a..7e598b3 100644 --- a/pkg/controller/status_updater_test.go +++ b/pkg/controller/status_updater_test.go @@ -128,10 +128,10 @@ var _ = Describe("Status Updater", func() { } condFunc := controller.GenerateCreateConditionFunc(rr) - condFunc("0CondType :,;-_.Test02@", metav1.ConditionTrue, "1Reason -.,:_Test93$", "Message") + condFunc("CondType :,;-_.Test02@", metav1.ConditionTrue, "Reason -.,:_Test93$", "Message") Expect(rr.Conditions).To(HaveLen(1)) - Expect(rr.Conditions[0].Type).To(Equal("T0CondType____-_.Test02_t")) - Expect(rr.Conditions[0].Reason).To(Equal("R1Reason___,:_Test93_r")) + Expect(rr.Conditions[0].Type).To(Equal("CondType____-_.Test02_")) + Expect(rr.Conditions[0].Reason).To(Equal("Reason___,:_Test93_")) }) It("should not update disabled fields", func() { From 13936e9192d2c08363b53d793646efe2ffd83667 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCnemann?= Date: Thu, 6 Nov 2025 16:37:57 +0100 Subject: [PATCH 2/3] feat: release v0.23.4 --- VERSION | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index b1729a7..670fd19 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.23.3-dev \ No newline at end of file +v0.23.4 \ No newline at end of file diff --git a/go.mod b/go.mod index fd2293c..0c3e291 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/uuid v1.6.0 github.com/onsi/ginkgo/v2 v2.27.2 github.com/onsi/gomega v1.38.2 - github.com/openmcp-project/controller-utils/api v0.23.3 + github.com/openmcp-project/controller-utils/api v0.23.4 github.com/spf13/pflag v1.0.10 github.com/stretchr/testify v1.11.1 go.uber.org/zap v1.27.0 From d5c1b1bf037b99331bda5832805a165e7b952eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Sch=C3=BCnemann?= Date: Thu, 6 Nov 2025 16:45:46 +0100 Subject: [PATCH 3/3] format --- pkg/conditions/updater.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/conditions/updater.go b/pkg/conditions/updater.go index a22e8a6..4731457 100644 --- a/pkg/conditions/updater.go +++ b/pkg/conditions/updater.go @@ -290,7 +290,7 @@ func ReplaceIllegalCharsInConditionType(s string) string { result = append(result, '_') } } - + return string(result) }