diff --git a/charts/bridge-history-api/templates/config-file.yaml b/charts/bridge-history-api/templates/config-file.yaml index 03668819..bbd22df7 100644 --- a/charts/bridge-history-api/templates/config-file.yaml +++ b/charts/bridge-history-api/templates/config-file.yaml @@ -1,4 +1,3 @@ -{{- if .Values.global.isStandalone }} --- apiVersion: v1 kind: ConfigMap @@ -9,5 +8,3 @@ metadata: data: bridge-history-config.json : | {{ .Values.scrollConfig | indent 4 }} ---- -{{- end }} diff --git a/charts/bridge-history-api/templates/helpers.tpl b/charts/bridge-history-api/templates/helpers.tpl new file mode 100644 index 00000000..d762ba10 --- /dev/null +++ b/charts/bridge-history-api/templates/helpers.tpl @@ -0,0 +1,47 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "scroll-sdk.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "scroll-sdk.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} +{{/* +Create chart name and build as used by the chart label. +*/}} +{{- define "scroll-sdk.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} +{{/* +Common labels +*/}} +{{- define "scroll-sdk.labels" -}} +helm.sh/chart: {{ include "scroll-sdk.chart" . }} +{{ include "scroll-sdk.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/build: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} +{{/* +Selector labels +*/}} +{{- define "scroll-sdk.selectorLabels" -}} +app.kubernetes.io/name: {{ include "scroll-sdk.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }}