From a9d3930ba3bce492981be197ca1b6abcb1b6105c Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 22 Sep 2025 19:54:57 +0800 Subject: [PATCH] fix: use where clause for conditional environment setting - Replace if statement with where clause for environment mapping - Set default to alpha, then override to prod for freeleaps-prod namespace --- .../templates/authentication/opentelemetry.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml index ba3406f9..0e7a22f1 100644 --- a/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml +++ b/freeleaps/helm-pkg/authentication/templates/authentication/opentelemetry.yaml @@ -79,8 +79,8 @@ spec: - context: log statements: - set(resource.attributes["service_name"], "authentication") - - set(resource.attributes["environment"], - if(resource.attributes["k8s.namespace.name"] == "freeleaps-prod", "prod", "alpha")) + - set(resource.attributes["environment"], "alpha") + - set(resource.attributes["environment"], "prod") where resource.attributes["k8s.namespace.name"] == "freeleaps-prod" - 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"])