Skip to content

Commit

Permalink
fix devfile registry entry name and ingress url
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Valdron <[email protected]>
  • Loading branch information
michael-valdron committed Mar 5, 2024
1 parent dd51121 commit 414b63f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
9 changes: 9 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,15 @@
{{- .Values.hostnameOverride | default (printf "devfile-registry-%s" .Release.Namespace) -}}
{{- 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.ingressUrl" . -}}
http:
paths:
- path: /
Expand Down

0 comments on commit 414b63f

Please sign in to comment.