From 867aa2c4cd52e40ce14f3640c7dc2c9b40e4ce69 Mon Sep 17 00:00:00 2001 From: Robert Lijkendijk Date: Wed, 17 Jul 2024 08:03:05 +0200 Subject: [PATCH] Add additional if statement before the annotations and remove trim --- charts/nginx-gateway-fabric/templates/deployment.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/charts/nginx-gateway-fabric/templates/deployment.yaml b/charts/nginx-gateway-fabric/templates/deployment.yaml index 6aba0e8af0..6abed60a4a 100644 --- a/charts/nginx-gateway-fabric/templates/deployment.yaml +++ b/charts/nginx-gateway-fabric/templates/deployment.yaml @@ -15,9 +15,10 @@ spec: metadata: labels: {{- include "nginx-gateway.selectorLabels" . | nindent 8 }} + {{- if or .Values.nginxGateway.podAnnotations .Values.metrics.enable }} annotations: {{- if .Values.nginxGateway.podAnnotations }} - {{- toYaml .Values.nginxGateway.podAnnotations | trim | nindent 8 }} + {{- toYaml .Values.nginxGateway.podAnnotations | nindent 8 }} {{- end }} {{- if .Values.metrics.enable }} prometheus.io/scrape: "true" @@ -26,6 +27,7 @@ spec: prometheus.io/scheme: "https" {{- end }} {{- end }} + {{- end }} spec: containers: - args: