From 239db41d16b3402c2a915aa61e404fc65d753812 Mon Sep 17 00:00:00 2001 From: Fred Dubois <169247+duboisf@users.noreply.github.com> Date: Wed, 15 Jan 2025 12:02:57 -0500 Subject: [PATCH] fix: properly indent service annotations (#25388) When then was more than 1 annotation on the service, it would not be properly indented. ``` $ cat test-values.yaml serviceAnnotations: foo: bar bar: baz baz: qux $ helm template fleet . -f test-values.yaml --show-only templates/service.yaml --- # Source: fleet/templates/service.yaml apiVersion: v1 kind: Service metadata: labels: app: fleet chart: fleet heritage: Helm release: fleet annotations: bar: baz baz: qux foo: bar name: fleet-service namespace: fleet spec: selector: app: fleet chart: fleet heritage: Helm release: fleet ports: - name: fleet port: 8080 targetPort: 8080 ``` before: ``` $ git checkout main $ helm template fleet . -f test-values.yaml --show-only templates/service.yaml --- # Source: fleet/templates/service.yaml apiVersion: v1 kind: Service metadata: labels: app: fleet chart: fleet heritage: Helm release: fleet annotations: bar: baz baz: qux foo: bar name: fleet-service namespace: fleet spec: selector: app: fleet chart: fleet heritage: Helm release: fleet ports: - name: fleet port: 8080 targetPort: 8080 --- charts/fleet/templates/service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/fleet/templates/service.yaml b/charts/fleet/templates/service.yaml index e814c80c3a61..8ec0acb1b7e3 100644 --- a/charts/fleet/templates/service.yaml +++ b/charts/fleet/templates/service.yaml @@ -10,7 +10,7 @@ metadata: {{- if .Values.serviceAnnotations }} annotations: {{- with .Values.serviceAnnotations}} - {{ toYaml . | trim | indent 2}} + {{- toYaml . | trim | nindent 4}} {{- end }} {{- end }} name: {{ $serviceName }}