mirror of
https://gitea.com/gitea/helm-chart
synced 2025-10-06 00:43:12 +02:00
chore: set implicit default for path
This commit is contained in:
@@ -33,6 +33,7 @@ spec:
|
||||
- host: {{ tpl .host $ | quote }}
|
||||
http:
|
||||
paths:
|
||||
{{- if .paths }}
|
||||
{{- range .paths }}
|
||||
{{- if kindIs "string" . }}
|
||||
- path: {{ . }}
|
||||
@@ -52,5 +53,14 @@ spec:
|
||||
number: {{ $httpPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- path: "/"
|
||||
pathType: "Prefix"
|
||||
backend:
|
||||
service:
|
||||
name: {{ $fullName }}-http
|
||||
port:
|
||||
number: {{ $httpPort }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
23
unittests/helm/ingress/implicit-defaults.yaml
Normal file
23
unittests/helm/ingress/implicit-defaults.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
suite: Test ingress with implicit path defaults
|
||||
templates:
|
||||
- templates/gitea/ingress.yaml
|
||||
tests:
|
||||
- it: should use default path and pathType when no paths are specified
|
||||
set:
|
||||
ingress.enabled: true
|
||||
ingress.hosts:
|
||||
- host: git.example.com
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- isKind:
|
||||
of: Ingress
|
||||
- equal:
|
||||
path: spec.rules[0].host
|
||||
value: "git.example.com"
|
||||
- equal:
|
||||
path: spec.rules[0].http.paths[0].path
|
||||
value: "/"
|
||||
- equal:
|
||||
path: spec.rules[0].http.paths[0].pathType
|
||||
value: "Prefix"
|
Reference in New Issue
Block a user