This repository was archived by the owner on Apr 1, 2025. It is now read-only.
File tree 4 files changed +43
-1
lines changed
4 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 5
5
{{- if .longName }}
6
6
{{- $resourceName = printf "%s-%s" $robustName (include "robustName" .ingress.host) -}}
7
7
{{- end }}
8
+ {{- $svcPort := .root.Values.svcPort -}}
9
+ {{- $containerPort := .root.Values.containerPort -}}
10
+
8
11
---
9
12
apiVersion : networking.k8s.io/v1
10
13
kind : Ingress
@@ -43,14 +46,27 @@ spec:
43
46
rules :
44
47
- host : {{ .ingress.host | quote }}
45
48
http :
49
+ {{- if not .ingress.paths }}
46
50
paths :
47
51
- path : {{ .ingress.path | default "/" | quote }}
48
52
pathType : {{ .ingress.pathType | default "Prefix" | quote }}
49
53
backend :
50
54
service :
51
55
name : {{ $robustName }}
52
56
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 }}
54
70
{{- end }}
55
71
56
72
{{- 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