Skip to content

Commit 4f41ec4

Browse files
feat: allow templates in annotations (#256)
--------- Co-authored-by: Pierluigi Lenoci <[email protected]>
1 parent 7c3571c commit 4f41ec4

13 files changed

+57
-23
lines changed

helm/oauth2-proxy/Chart.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: oauth2-proxy
2-
version: 7.7.31
2+
version: 7.8.0
33
apiVersion: v2
44
appVersion: 7.7.1
55
home: https://oauth2-proxy.github.io/oauth2-proxy/
@@ -34,8 +34,8 @@ maintainers:
3434
kubeVersion: ">=1.16.0-0"
3535
annotations:
3636
artifacthub.io/changes: |
37-
- kind: fixed
38-
description: Added missing executable permission for check-redis.sh
37+
- kind: added
38+
description: allow templates in annotations
3939
links:
4040
- name: Github PR
41-
url: https://github.com/oauth2-proxy/manifests/pull/255
41+
url: https://github.com/oauth2-proxy/manifests/pull/256

helm/oauth2-proxy/ci/tpl-values.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ ingress:
88
tls:
99
- hosts:
1010
- "{{ $.Release.Name }}.local"
11+
annotations:
12+
test-annotations/test: "{{ $.Release.Name }}"
1113
oauth2-proxy:
1214
checkDeprecation: false
1315
config:
@@ -27,3 +29,34 @@ extraVolumes:
2729
items:
2830
- key: secret
2931
path: secret
32+
33+
authenticatedEmailsFile:
34+
annotations:
35+
test-annotations/test: "{{ $.Release.Name }}"
36+
37+
config:
38+
annotations:
39+
test-annotations/test: "{{ $.Release.Name }}"
40+
41+
deploymentAnnotations:
42+
test-annotations/test: "{{ $.Release.Name }}"
43+
44+
autoscaling:
45+
annotations:
46+
test-annotations/test: "{{ $.Release.Name }}"
47+
48+
alphaConfig:
49+
annotations:
50+
test-annotations/test: "{{ $.Release.Name }}"
51+
52+
service:
53+
annotations:
54+
test-annotations/test: "{{ $.Release.Name }}"
55+
56+
serviceAccount:
57+
annotations:
58+
test-annotations/test: "{{ $.Release.Name }}"
59+
60+
serviceMonitor:
61+
annotations:
62+
test-annotations/test: "{{ $.Release.Name }}"

helm/oauth2-proxy/templates/configmap-authenticated-emails-file.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ metadata:
66
labels:
77
app: {{ template "oauth2-proxy.name" . }}
88
{{- include "oauth2-proxy.labels" . | indent 4 }}
9-
{{- if .Values.authenticatedEmailsFile.annotations }}
9+
{{- with .Values.authenticatedEmailsFile.annotations }}
1010
annotations:
11-
{{ toYaml .Values.authenticatedEmailsFile.annotations | indent 4 }}
11+
{{ tpl ( toYaml . ) $ | indent 4 }}
1212
{{- end }}
1313
name: {{ template "oauth2-proxy.fullname" . }}-accesslist
1414
namespace: {{ template "oauth2-proxy.namespace" $ }}

helm/oauth2-proxy/templates/configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
apiVersion: v1
44
kind: ConfigMap
55
metadata:
6-
{{- if .Values.config.annotations }}
6+
{{- with .Values.config.annotations }}
77
annotations:
8-
{{ toYaml .Values.config.annotations | indent 4 }}
8+
{{ tpl ( toYaml . ) $ | indent 4 }}
99
{{- end }}
1010
labels:
1111
app: {{ template "oauth2-proxy.name" . }}

helm/oauth2-proxy/templates/deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ metadata:
44
labels:
55
app: {{ template "oauth2-proxy.name" . }}
66
{{- include "oauth2-proxy.labels" . | indent 4 }}
7-
{{- if .Values.deploymentAnnotations }}
7+
{{- with .Values.deploymentAnnotations }}
88
annotations:
9-
{{ toYaml .Values.deploymentAnnotations | indent 4 }}
9+
{{ tpl ( toYaml . ) $ | indent 4 }}
1010
{{- end }}
1111
name: {{ template "oauth2-proxy.fullname" . }}
1212
namespace: {{ template "oauth2-proxy.namespace" $ }}

helm/oauth2-proxy/templates/hpa.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ metadata:
55
labels:
66
app: {{ template "oauth2-proxy.name" . }}
77
{{- include "oauth2-proxy.labels" . | indent 4 }}
8-
{{- if .Values.autoscaling.annotations }}
8+
{{- with .Values.autoscaling.annotations }}
99
annotations:
10-
{{ toYaml .Values.autoscaling.annotations | indent 8 }}
10+
{{ tpl ( toYaml . ) $ | indent 8 }}
1111
{{- end }}
1212
name: {{ template "oauth2-proxy.fullname" . }}
1313
namespace: {{ template "oauth2-proxy.namespace" $ }}

helm/oauth2-proxy/templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ metadata:
1717
namespace: {{ template "oauth2-proxy.namespace" $ }}
1818
{{- with .Values.ingress.annotations }}
1919
annotations:
20-
{{ toYaml . | indent 4 }}
20+
{{ tpl ( toYaml . ) $ | indent 4 }}
2121
{{- end }}
2222
spec:
2323
{{- if and .Values.ingress.className ( eq "true" ( include "ingress.supportsIngressClassName" . ) ) }}

helm/oauth2-proxy/templates/secret-alpha.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
apiVersion: v1
88
kind: Secret
99
metadata:
10-
{{- if .Values.alphaConfig.annotations }}
11-
annotations: {{- toYaml .Values.alphaConfig.annotations | nindent 4 }}
10+
{{- with .Values.alphaConfig.annotations }}
11+
annotations:
12+
{{ tpl ( toYaml . ) $ | indent 4 }}
1213
{{- end }}
1314
labels:
1415
app: {{ template "oauth2-proxy.name" . }}

helm/oauth2-proxy/templates/secret-authenticated-emails-file.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ metadata:
77
labels:
88
app: {{ template "oauth2-proxy.name" . }}
99
{{- include "oauth2-proxy.labels" . | indent 4 }}
10-
{{- if .Values.authenticatedEmailsFile.annotations }}
10+
{{- with .Values.authenticatedEmailsFile.annotations }}
1111
annotations:
12-
{{ toYaml .Values.authenticatedEmailsFile.annotations | indent 4 }}
12+
{{ tpl ( toYaml . ) $ | indent 4 }}
1313
{{- end }}
1414
name: {{ template "oauth2-proxy.fullname" . }}-accesslist
1515
namespace: {{ template "oauth2-proxy.namespace" $ }}

helm/oauth2-proxy/templates/secret.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
apiVersion: v1
33
kind: Secret
44
metadata:
5-
{{- if .Values.config.annotations }}
5+
{{- with .Values.config.annotations }}
66
annotations:
7-
{{ toYaml .Values.config.annotations | indent 4 }}
7+
{{ tpl ( toYaml . ) $ | indent 4 }}
88
{{- end }}
99
labels:
1010
app: {{ template "oauth2-proxy.name" . }}

0 commit comments

Comments
 (0)