From: mpriyank Date: Fri, 5 Sep 2025 13:33:43 +0000 (+0100) Subject: [COMMON] Enhance the strimzi template function X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F95%2F141995%2F1;p=oom.git [COMMON] Enhance the strimzi template function - enhanced the strimzi helm template function to adhering to k8s object naming rules as per https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ - underscores to be replaced with hyphens and prefix and suffix hyphens will be trimmed to make it a valid k8s object name Issue-ID: CPS-2977 Change-Id: I255c257cd97c61c80b2e4e8dec8dd2de0a0d6dfd Signed-off-by: mpriyank --- diff --git a/kubernetes/common/common/templates/_strimzikafka.tpl b/kubernetes/common/common/templates/_strimzikafka.tpl index c3c4cc7d92..34441c9dd8 100644 --- a/kubernetes/common/common/templates/_strimzikafka.tpl +++ b/kubernetes/common/common/templates/_strimzikafka.tpl @@ -114,9 +114,9 @@ apiVersion: kafka.strimzi.io/v1beta2 kind: KafkaTopic metadata: {{- if (hasKey $topic "strimziTopicName") }} - name: {{ ($topic.strimziTopicName) }}-kt + name: {{ ($topic.strimziTopicName | replace "_" "-" | trimPrefix "-" | trimSuffix "-") }}-kt {{- else }} - name: {{ ($topic.name) | lower }}-kt + name: {{ ($topic.name | lower | replace "_" "-" | trimPrefix "-" | trimSuffix "-") }}-kt {{- end }} labels: {{- include "common.labels" $ | nindent 4 }}