1
0
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:
pat-s
2025-05-05 11:05:39 +02:00
parent 4efff4ef31
commit abb0d40781
2 changed files with 33 additions and 0 deletions

View File

@@ -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 }}

View 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"