Namespace override

This patch makes it possible to install the subcharts in different
namespaces as needed.

Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
kfox1111
2023-03-13 15:03:16 -07:00
committed by GitHub
parent 661000a29a
commit 03db6bb5fe
40 changed files with 221 additions and 58 deletions
@@ -23,6 +23,25 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}
{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "spire-agent.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
{{- define "spire-agent.server.namespace" -}}
{{- if .Values.server.namespaceOverride -}}
{{- .Values.server.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
@@ -77,7 +96,7 @@ Create the name of the service account to use
{{- if .Values.server.address }}
{{- .Values.server.address }}
{{- else }}
{{ .Release.Name }}-server
{{ .Release.Name }}-server.{{ include "spire-agent.server.namespace" . }}
{{- end }}
{{- end }}