Skip to content

Commit 273b091

Browse files
committed
[prometheus-fastly-exporter] add backward compatibility for legacy ingress values
Support both legacy format (hosts as strings + top-level path) and modern format (hosts as objects with host/paths/pathType). Uses kindIs to detect string hosts and falls back to ingress.path for the path. Signed-off-by: Denis Arslanbekov <denis@arslanbekov.com>
1 parent bdce8df commit 273b091

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

charts/prometheus-fastly-exporter/templates/ingress.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,18 @@ spec:
2727
{{- end }}
2828
rules:
2929
{{- range .Values.ingress.hosts }}
30+
{{- if kindIs "string" . }}
31+
- host: {{ . | quote }}
32+
http:
33+
paths:
34+
- path: {{ $.Values.ingress.path | default "/" }}
35+
pathType: ImplementationSpecific
36+
backend:
37+
service:
38+
name: {{ $fullName }}
39+
port:
40+
number: {{ $svcPort }}
41+
{{- else }}
3042
- host: {{ .host | quote }}
3143
http:
3244
paths:
@@ -40,4 +52,5 @@ spec:
4052
number: {{ $svcPort }}
4153
{{- end }}
4254
{{- end }}
55+
{{- end }}
4356
{{- end }}

charts/prometheus-fastly-exporter/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ ingress:
5252
# className: nginx
5353
annotations: {}
5454
# kubernetes.io/tls-acme: "true"
55+
# Legacy format (still supported):
56+
# path: /
57+
# hosts:
58+
# - chart-example.local
59+
# Modern format (recommended):
5560
hosts:
5661
- host: chart-example.local
5762
paths:

0 commit comments

Comments
 (0)