Skip to content

Commit

Permalink
build(chart): remove duplicates in client/server charts
Browse files Browse the repository at this point in the history
  • Loading branch information
cramakri committed Aug 12, 2022
1 parent d57c5c4 commit fe3bfd1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 15 additions & 0 deletions helm-chart/renku-ui/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,18 @@ Hack for calling templates in a fake scope (until this is solved https://github.
{{- $template := index . 2 }}
{{- include $template (dict "Chart" (dict "Name" $subchart) "Values" (index $dot.Values $subchart) "Release" $dot.Release "Capabilities" $dot.Capabilities) }}
{{- end }}

{{/*
Variables for connecting ui to ui-server
*/}}
{{- define "ui.uiserverUrlSchemeDomain" -}}
{{- .Values.server.serverData.url | default (printf "https://%s" .Values.global.renku.domain) -}}
{{- end -}}

{{- define "ui.uiserverUrlPath" -}}
{{- .Values.server.serverData.prefix | default (printf "/ui-server") -}}
{{- end -}}

{{- define "ui.uiserverUrl" -}}
{{- printf "%s%s" (include "ui.uiserverUrlSchemeDomain" .) (include "ui.uiserverUrlPath" .) -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ spec:
- name: GATEWAY_URL
value: {{ .Values.gatewayUrl | default (printf "%s://%s/api" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
- name: UISERVER_URL
value: {{ .Values.client.uiserverUrl | default (printf "%s://%s/ui-server" (include "ui.protocol" .) .Values.global.renku.domain) | quote }}
value: {{ (include "ui.uiserverUrl" .) | quote }}
- name: WELCOME_PAGE
value: {{ .Values.client.welcomePage.text | b64enc | quote }}
{{- if .Values.client.statuspage }}
Expand Down
4 changes: 2 additions & 2 deletions helm-chart/renku-ui/templates/ui-server-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ spec:
protocol: TCP
env:
- name: SERVER_URL
value: {{ .Values.server.serverData.url | default (printf "https://%s" .Values.global.renku.domain) | quote }}
value: {{ (include "ui.uiserverUrlSchemeDomain" .) | quote }}
- name: UI_SERVER_VERSION
value: {{ .Chart.Version | quote }}
- name: SERVER_PORT
value: {{ .Values.server.serverData.port | default (printf "8080") | quote }}
- name: SERVER_PREFIX
value: {{ .Values.server.serverData.prefix | default (printf "/ui-server") | quote }}
value: {{ (include "ui.uiserverUrlPath" .) | quote }}
- name: GATEWAY_URL
value: {{ .Values.server.gateway.url | default (printf "https://%s/api" .Values.global.renku.domain) | quote }}
- name: GATEWAY_LOGIN_PATH
Expand Down

0 comments on commit fe3bfd1

Please sign in to comment.