feat: adding 'tpl' to ingress annotation values (#1124)
### Description of the change
Adding templating support into ingress annotations so the following can be used (hence avoiding YAML anchors):
```
ingress:
className: "{{ .Values.global.ingress.className }}"
annotations:
cert-manager.io/issuer: "{{ .Values.global.issuer.name }}"
```
### Benefits
- avoiding use of YAML anchors and related limitations
- Possibility to inject a value into an annotation even from an umbrella chart
### Checklist
<!-- [Place an '[X]' (no spaces) in all applicable fields. Please remove unrelated fields.] -->
- [x] Helm templating unittests are added (required when changing anything in `templates` folder)
Reviewed-on: https://gitea.com/gitea/helm-gitea/pulls/1124
Reviewed-by: Markus Pesch <1641+volker.raschek@noreply.gitea.com>
Co-authored-by: Ceddaerrix <48319+ceddaerrix@noreply.gitea.com>
This commit is contained in:
1 parent
304f50981d
commit
ddd0290b55
2 files changed
+104
-4
No files matched your search
@@ -3,10 +3,10 @@
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
{{- with (include "gitea.ingress.annotations" .) }}
|
||||
{{- with (include "gitea.ingress.annotations" $) }}
|
||||
annotations:
|
||||
{{- . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- tpl . $ | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with (include "gitea.ingress.labels" .) }}
|
||||
labels:
|
||||
{{- . | nindent 4 }}
|
||||
@@ -14,7 +14,7 @@ metadata:
|
||||
name: {{ include "gitea.ingress.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
ingressClassName: {{ tpl .Values.ingress.ingressClassName . }}
|
||||
ingressClassName: {{ tpl .Values.ingress.ingressClassName $ }}
|
||||
rules:
|
||||
{{- range .Values.ingress.hosts }}
|
||||
- host: {{ tpl .host $ | quote }}
|
||||
|
||||
Reference in new issue
Block a user