Skip to content

Commit 251acb8

Browse files
committed
CH-267 fix ingress path issue
additionally, renamed ingresses to avoid name clashes
1 parent e262f06 commit 251acb8

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

deployment-configuration/helm/templates/ingress.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,27 @@
1010
{{- range $mapping := $app.harness.uri_role_mapping }}
1111
{{- if and (hasKey $mapping "white-listed") (index $mapping "white-listed") }}
1212
{{- $uri := $mapping.uri }}
13-
{{- if eq $uri "/" }}
14-
- path: /
15-
pathType: Exact
16-
backend:
17-
service:
18-
name: {{ $app.harness.service.name | quote }}
19-
port:
20-
number: {{ $app.harness.service.port | default 80 }}
21-
{{- else if hasSuffix "/*" $uri }}
22-
{{- $cleanPath := trimSuffix "/*" $uri }}
23-
{{- $pathWithoutSlash := trimPrefix "/" $cleanPath }}
13+
{{- if and (ne $uri "/") (ne $uri "/*") }}
14+
{{- if hasSuffix "/*" $uri }}
15+
{{- $cleanPath := trimSuffix "/*" $uri }}
16+
{{- $pathWithoutSlash := trimPrefix "/" $cleanPath }}
2417
- path: {{ printf "%s%s" $app.harness.gateway.path $pathWithoutSlash }}
2518
pathType: Prefix
2619
backend:
2720
service:
2821
name: {{ $app.harness.service.name | quote }}
2922
port:
3023
number: {{ $app.harness.service.port | default 80 }}
31-
{{- else if (not (contains "*" $uri)) }}
32-
{{- $pathWithoutSlash := trimPrefix "/" $uri }}
24+
{{- else if (not (contains "*" $uri)) }}
25+
{{- $pathWithoutSlash := trimPrefix "/" $uri }}
3326
- path: {{ printf "%s%s" $app.harness.gateway.path $pathWithoutSlash }}
3427
pathType: Exact
3528
backend:
3629
service:
3730
name: {{ $app.harness.service.name | quote }}
3831
port:
3932
number: {{ $app.harness.service.port | default 80 }}
33+
{{- end }}
4034
{{- end }}
4135
{{- end }}
4236
{{- end }}
@@ -68,7 +62,7 @@
6862
{{- $mainapp := .Values.mainapp }}
6963
{{- range $app := .Values.apps }}
7064
{{- if or $app.harness.subdomain $app.harness.domain $app.harness.aliases (and $mainapp (and $app.harness.name (eq $app.harness.name $mainapp))) }}
71-
{{- $appIngressName := default $app.harness.name $app.harness.service.name }}
65+
{{- $appIngressName := default $app.harness.service.name $app.harness.name }}
7266
---
7367
apiVersion: networking.k8s.io/v1
7468
kind: Ingress

0 commit comments

Comments
 (0)