This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55{{- if .longName }}
66{{- $resourceName = printf "%s-%s" $robustName (include "robustName" .ingress.host) -}}
77{{- end }}
8+ {{- $svcPort := .root.Values.svcPort -}}
9+ {{- $containerPort := .root.Values.containerPort -}}
10+
811---
912apiVersion : networking.k8s.io/v1
1013kind : Ingress
@@ -43,14 +46,27 @@ spec:
4346 rules :
4447 - host : {{ .ingress.host | quote }}
4548 http :
49+ {{- if not .ingress.paths }}
4650 paths :
4751 - path : {{ .ingress.path | default "/" | quote }}
4852 pathType : {{ .ingress.pathType | default "Prefix" | quote }}
4953 backend :
5054 service :
5155 name : {{ $robustName }}
5256 port :
53- number : {{ if .root.Values.svcPort }}{{ .root.Values.svcPort }}{{ else }}{{ .root.Values.containerPort }}{{ end }}
57+ number : {{ if $svcPort }}{{ $svcPort }}{{ else }}{{ $containerPort }}{{ end }}
58+ {{- else }}
59+ paths :
60+ {{- range .ingress.paths }}
61+ - path : {{ .path | quote }}
62+ pathType : {{ .pathType | default "Prefix" | quote }}
63+ backend :
64+ service :
65+ name : {{ $robustName }}
66+ port :
67+ number : {{ if $svcPort }}{{ $svcPort }}{{ else }}{{ $containerPort }}{{ end }}
68+ {{- end }}
69+ {{- end }}
5470{{- end }}
5571
5672{{- with .Values.ingress }}
Original file line number Diff line number Diff line change 1+ suite : test ingress
2+ templates :
3+ - ingress.yaml
4+ tests :
5+ - it : Should default
6+ set :
7+ ingress :
8+ host : chart-example.local
9+ asserts :
10+ - equal :
11+ path : spec.rules[0].http.paths[0].path
12+ value : " /"
13+ - it : Should use paths
14+ set :
15+ ingress :
16+ host : chart-example.local
17+ paths :
18+ - path : /mypath
19+ - path : /mypath2
20+ asserts :
21+ - equal :
22+ path : spec.rules[0].http.paths[0].path
23+ value : " /mypath"
24+ - equal :
25+ path : spec.rules[0].http.paths[1].path
26+ value : " /mypath2"
You can’t perform that action at this time.
0 commit comments