diff --git a/charts/ratify/templates/_helpers.tpl b/charts/ratify/templates/_helpers.tpl index cc56acb9e..db0e4da18 100644 --- a/charts/ratify/templates/_helpers.tpl +++ b/charts/ratify/templates/_helpers.tpl @@ -8,7 +8,13 @@ Expand the name of the chart. {{- define "ratify.podLabels" -}} {{- if .Values.podLabels }} -{{- toYaml .Values.podLabels | nindent 8 }} +{{- toYaml .Values.podLabels }} +{{- end }} +{{- end }} + +{{- define "ratify.podAnnotations" -}} +{{- if .Values.podAnnotations }} +{{- toYaml .Values.podAnnotations }} {{- end }} {{- end }} diff --git a/charts/ratify/templates/deployment.yaml b/charts/ratify/templates/deployment.yaml index 46ed544ae..3c3a630ee 100644 --- a/charts/ratify/templates/deployment.yaml +++ b/charts/ratify/templates/deployment.yaml @@ -13,11 +13,13 @@ spec: template: metadata: labels: + {{- include "ratify.podLabels" . | nindent 8 }} {{- include "ratify.selectorLabels" . | nindent 8 }} {{- if ne .Values.azureWorkloadIdentity.clientId "" }} azure.workload.identity/use: "true" {{- end }} annotations: + {{- include "ratify.podAnnotations" . | nindent 8 }} {{- if eq .Values.instrumentation.metricsType "prometheus" }} prometheus.io/scrape: "true" prometheus.io/port: {{ .Values.instrumentation.metricsPort | quote }} diff --git a/charts/ratify/templates/upgrade-crds-hook.yaml b/charts/ratify/templates/upgrade-crds-hook.yaml index a843c66cc..48e21f020 100644 --- a/charts/ratify/templates/upgrade-crds-hook.yaml +++ b/charts/ratify/templates/upgrade-crds-hook.yaml @@ -78,7 +78,7 @@ spec: annotations: {{- toYaml .Values.podAnnotations | trim | nindent 8 }} labels: - {{- include "ratify.podLabels" . }} + {{- include "ratify.podLabels" . | nindent 8 }} app: '{{ template "ratify.name" . }}' chart: '{{ template "ratify.name" . }}' ratify.sh/system: "yes"