Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 💥 deployment.podannotations support interpolation with tpl #972

Merged
merged 4 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{{- define "traefik.podTemplate" }}
metadata:
annotations:
{{- with .Values.deployment.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- if .Values.deployment.podAnnotations }}
{{- tpl (toYaml .Values.deployment.podAnnotations) . | nindent 8 }}
{{- end }}
{{- if .Values.metrics }}
{{- if and (.Values.metrics.prometheus) (not .Values.metrics.prometheus.serviceMonitor) }}
Expand Down
22 changes: 22 additions & 0 deletions traefik/tests/deployment-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,28 @@ tests:
- equal:
path: spec.template.metadata.annotations.traefik/powpow
value: podAnnotations
- it: should have podAnnotations with specified values
set:
type: 'internal'
deployment:
podAnnotations:
traefik/powpow: podAnnotations
traefik/name: '{{ template "traefik.name" . }}'
traefik/{{ template "traefik.name" . }}.logs: 'log_processing_rules'
traefik/type: '{{ .Values.type }}'
asserts:
- equal:
path: spec.template.metadata.annotations.traefik/powpow
value: podAnnotations
- equal:
path: spec.template.metadata.annotations.traefik/name
value: 'traefik'
- equal:
path: spec.template.metadata.annotations["traefik/traefik.logs"]
value: 'log_processing_rules'
- equal:
path: spec.template.metadata.annotations.traefik/type
value: 'internal'
- it: should have labels with specified values
set:
deployment:
Expand Down
2 changes: 2 additions & 0 deletions traefik/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ deployment:
labels: {}
# -- Additional pod annotations (e.g. for mesh injection or prometheus scraping)
podAnnotations: {}
# traefik/name: '{{ template "traefik.name" . }}'

# -- Additional Pod labels (e.g. for filtering Pod by custom labels)
ivankatliarchuk marked this conversation as resolved.
Show resolved Hide resolved
podLabels: {}
# -- Additional containers (e.g. for metric offloading sidecars)
Expand Down
Loading