diff --git a/charts/plugin-barman-cloud/templates/deployment.yaml b/charts/plugin-barman-cloud/templates/deployment.yaml index f324ac1573..3f4a78c695 100644 --- a/charts/plugin-barman-cloud/templates/deployment.yaml +++ b/charts/plugin-barman-cloud/templates/deployment.yaml @@ -38,6 +38,10 @@ spec: type: Recreate template: metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} labels: {{- include "plugin-barman-cloud.selectorLabels" . | nindent 8 }} {{- with .Values.podLabels }} diff --git a/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations-assert.yaml b/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations-assert.yaml new file mode 100644 index 0000000000..93bfa8d0a0 --- /dev/null +++ b/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations-assert.yaml @@ -0,0 +1,10 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: plugin-barman-cloud +spec: + template: + metadata: + annotations: + example.com/static: "static-value" + example.com/release: "plugin-barman-cloud" diff --git a/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations.yaml b/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations.yaml new file mode 100644 index 0000000000..ec6a51580e --- /dev/null +++ b/charts/plugin-barman-cloud/test/simple-deployment/03-pod_annotations.yaml @@ -0,0 +1,10 @@ +podAnnotations: + example.com/static: "static-value" + example.com/release: "{{ .Release.Name }}" +resources: + limits: + cpu: 100m + memory: 200Mi + requests: + cpu: 100m + memory: 100Mi diff --git a/charts/plugin-barman-cloud/test/simple-deployment/chainsaw-test.yaml b/charts/plugin-barman-cloud/test/simple-deployment/chainsaw-test.yaml index 5c303c07c7..2c0ea77ee9 100644 --- a/charts/plugin-barman-cloud/test/simple-deployment/chainsaw-test.yaml +++ b/charts/plugin-barman-cloud/test/simple-deployment/chainsaw-test.yaml @@ -35,6 +35,18 @@ spec: plugin-barman-cloud ../../ - assert: file: ./02-loglevel_override-assert.yaml + - name: Set pod annotations + try: + - script: + content: | + helm upgrade \ + --install \ + --namespace $NAMESPACE \ + --values ./03-pod_annotations.yaml \ + --wait \ + plugin-barman-cloud ../../ + - assert: + file: ./03-pod_annotations-assert.yaml - name: Cleanup try: - script: