Skip to content

Commit

Permalink
Fix devfile registry entry name and ingress url (#203)
Browse files Browse the repository at this point in the history
* fix devfile registry entry name and ingress url

Signed-off-by: Michael Valdron <[email protected]>

* add ingress hostname definition without protocol for ingress spec

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron authored Mar 6, 2024
1 parent dd51121 commit ffc3a09
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions deploy/chart/devfile-registry/templates/_template.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
{{- .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- end -}}

{{- define "devfileregistry.ingressHostname" -}}
{{- $hostname := .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- .Values.global.ingress.domain | printf "%s.%s" $hostname -}}
{{- end -}}

{{- define "devfileregistry.ingressUrl" -}}
{{- $hostname := .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- if .Values.global.tlsEnabled -}}
{{- .Values.global.ingress.domain | printf "https://%s.%s" $hostname -}}
{{- else -}}
{{- .Values.global.ingress.domain | printf "http://%s.%s" $hostname -}}
{{- end -}}
{{- end -}}

{{- define "devfileregistry.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
Expand Down
4 changes: 2 additions & 2 deletions deploy/chart/devfile-registry/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ spec:
value: |
[
{
"name": "Community",
"name": "{{ template "devfileregistry.name" . }}",
"url": "http://localhost:8080",
"fqdn": "http://{{ .Release.Name }}-{{ .Release.Namespace }}.{{ .Values.global.ingress.domain }}"
"fqdn": "{{ template "devfileregistry.ingressUrl" . }}"
}
]
volumeMounts:
Expand Down
2 changes: 1 addition & 1 deletion deploy/chart/devfile-registry/templates/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ metadata:
kubernetes.io/ingress.class: {{ .Values.global.ingress.class }}
spec:
rules:
- host: {{ template "devfileregistry.hostname" . -}} . {{- .Values.global.ingress.domain }}
- host: {{ template "devfileregistry.ingressHostname" . }}
http:
paths:
- path: /
Expand Down

0 comments on commit ffc3a09

Please sign in to comment.