diff --git a/charts/application-core/Chart.yaml b/charts/application-core/Chart.yaml index ae8f990..89163e6 100644 --- a/charts/application-core/Chart.yaml +++ b/charts/application-core/Chart.yaml @@ -15,7 +15,8 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 4.2.4 +version: 4.2.5 + maintainers: - name: Dominic DePasquale diff --git a/charts/application-core/templates/_helpers.tpl b/charts/application-core/templates/_helpers.tpl index 1a03444..11192ff 100644 --- a/charts/application-core/templates/_helpers.tpl +++ b/charts/application-core/templates/_helpers.tpl @@ -5,6 +5,17 @@ Expand the name of the chart. {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} +{{/* +Build the env that gets injected into the deployments +*/}} +{{- define "application-core.env" -}} +- name: APP_NAME + value: {{ .Values.appName | default (printf "%s-%s" .Release.Namespace .Release.Name) }} +{{- if .Values.env }} +{{ .Values.env | toYaml }} +{{- end }} +{{- 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). diff --git a/charts/application-core/templates/deployment.yaml b/charts/application-core/templates/deployment.yaml index ab5f9d2..cad30b2 100644 --- a/charts/application-core/templates/deployment.yaml +++ b/charts/application-core/templates/deployment.yaml @@ -68,10 +68,8 @@ spec: - {{ . }} {{- end }} {{- end }} - {{- if or .Values.env }} env: - {{- .Values.env | toYaml | nindent 12 }} - {{- end }} + {{- include "application-core.env" . | nindent 12 }} {{- if or .Values.externalSecret.enabled .Values.configMap.enabled .Values.extraConfigMaps .Values.extraSecrets }} envFrom: {{- if .Values.configMap.enabled }} @@ -148,10 +146,8 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} {{- end }} - {{- if or .Values.env }} env: - {{- .Values.env | toYaml | nindent 12 }} - {{- end }} + {{- include "application-core.env" . | nindent 12 }} {{- if or .Values.externalSecret.enabled .Values.configMap.enabled .Values.extraConfigMaps .Values.extraSecrets }} envFrom: {{- if .Values.configMap.enabled }} diff --git a/charts/application-core/values.yaml b/charts/application-core/values.yaml index 6514845..3a8dbb2 100644 --- a/charts/application-core/values.yaml +++ b/charts/application-core/values.yaml @@ -99,6 +99,8 @@ configMap: command: [] +appName: "" + env: [] # - name: FOO # value: BAR