Skip to content

Commit

Permalink
Copy rules when updating instance ingress eclipse-theia/theia-cloud#206
Browse files Browse the repository at this point in the history
  • Loading branch information
jfaltermeier committed Aug 2, 2023
1 parent 62a52cf commit e961e4b
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/theia.cloud/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.8.1-v004
version: 0.8.1-v005

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
20 changes: 20 additions & 0 deletions charts/theia.cloud/templates/instances-ingress-path-based.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@ spec:
- hosts:
- {{ tpl (.Values.hosts.paths.baseHost | toString) . }}
{{- end }}
{{- if not (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .) ) }}
rules:
- host: {{ tpl (.Values.hosts.paths.baseHost | toString) . }}
http:
{{- else }}
rules:
{{ range $rule := (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .)).spec.rules }}
- host: {{ .host }}
{{ if .http }}
http:
paths:
{{ with index .http.paths 0 }}
- path: {{ .path }}
pathType: Prefix
backend:
service:
name: {{ .backend.service.name }}
port:
number: {{ .backend.service.port.number }}
{{- end }}
{{ end }}
{{- end }}
{{- end }}
{{- end }}
20 changes: 20 additions & 0 deletions charts/theia.cloud/templates/instances-ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,27 @@ spec:
- {{ tpl (.Values.hosts.instance | toString) . }}
secretName: ws-cert-secret
{{- end }}
{{- if not (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .) ) }}
rules:
- host: {{ tpl (.Values.hosts.instance | toString) . }}
http:
{{- else }}
rules:
{{ range $rule := (lookup "networking.k8s.io/v1" "Ingress" .Release.Namespace (tpl (.Values.ingress.instanceName | toString) .)).spec.rules }}
- host: {{ .host }}
{{ if .http }}
http:
paths:
{{ with index .http.paths 0 }}
- path: {{ .path }}
pathType: Prefix
backend:
service:
name: {{ .backend.service.name }}
port:
number: {{ .backend.service.port.number }}
{{- end }}
{{ end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit e961e4b

Please sign in to comment.