From 0774325bf6c3a62e0f06a81f26843e40955ea444 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Sep 2025 19:53:13 +0800 Subject: [PATCH] fix: use if statement instead of ReplaceAll for environment mapping - Replace ReplaceAll function with if statement for environment mapping - This avoids undefined function error in OpenTelemetry Collector OTTL --- .../authentication/templates/authentication/opentelemetry.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index 470e084a..ba3406f9 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -80,7 +80,7 @@ spec: statements: - set(resource.attributes["service_name"], "authentication") - set(resource.attributes["environment"], - ReplaceAll(resource.attributes["k8s.namespace.name"], "freeleaps-", "")) + if(resource.attributes["k8s.namespace.name"] == "freeleaps-prod", "prod", "alpha")) - set(resource.attributes["pod_ip"], resource.attributes["k8s.pod.ip"]) - set(resource.attributes["pod_name"], resource.attributes["k8s.pod.name"]) - set(resource.attributes["kubernetes_node_name"], resource.attributes["k8s.node.name"])