Skip to content

Commit

Permalink
feat: add helper templates to generate default api service name (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
muse-sisay authored Dec 4, 2024
1 parent 96efca3 commit 6268a80
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/console/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}

{{- define "kubefirst-api.serviceName" -}}
{{- printf "%s-api" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/console/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
- name: {{ .Chart.Name }}
env:
- name: API_URL
value: {{ .Values.apiURL | default (printf "http://%s.%s.svc.cluster.local" ( include "console.fullname" . ) (.Release.Namespace )) }}
value: {{ .Values.apiURL | default (printf "http://%s.%s.svc.cluster.local" ( include "kubefirst-api.serviceName" . ) ( .Release.Namespace )) }}
- name: KUBEFIRST_VERSION
value: {{ .Values.global.kubefirstVersion }}
- name: IS_CLUSTER_ZERO
Expand Down

0 comments on commit 6268a80

Please sign in to comment.