Move reusable macros to root chart (#218)
This patch adds the start of a library to help reduce code duplication. It will be split out to its own library chart at the same time the other charts are split out. --------- Signed-off-by: Kevin Fox <[email protected]>
This commit is contained in:
@@ -82,18 +82,6 @@ Create the name of the service account to use
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.image" -}}
|
||||
{{- if eq (substr 0 7 .image.version) "sha256:" -}}
|
||||
{{- printf "%s/%s@%s" .image.registry .image.repository .image.version -}}
|
||||
{{- else if .appVersion -}}
|
||||
{{- printf "%s/%s:%s" .image.registry .image.repository (default .appVersion .image.version) -}}
|
||||
{{- else if .image.version -}}
|
||||
{{- printf "%s/%s:%s" .image.registry .image.repository .image.version -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s/%s" .image.registry .image.repository -}}
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.upstream-ca-secret" -}}
|
||||
{{- $root := . }}
|
||||
{{- with .Values.upstreamAuthority.disk -}}
|
||||
@@ -117,34 +105,3 @@ Create the name of the service account to use
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.cluster-name" }}
|
||||
{{- if ne (len (dig "spire" "clusterName" "" .Values.global)) 0 }}
|
||||
{{- .Values.global.spire.clusterName }}
|
||||
{{- else }}
|
||||
{{- .Values.clusterName }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.trust-domain" }}
|
||||
{{- if ne (len (dig "spire" "trustDomain" "" .Values.global)) 0 }}
|
||||
{{- .Values.global.spire.trustDomain }}
|
||||
{{- else }}
|
||||
{{- .Values.trustDomain }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.bundle-configmap" }}
|
||||
{{- if ne (len (dig "spire" "bundleConfigMap" "" .Values.global)) 0 }}
|
||||
{{- .Values.global.spire.bundleConfigMap }}
|
||||
{{- else }}
|
||||
{{- .Values.bundleConfigMap }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "spire-server.cluster-domain" -}}
|
||||
{{- if ne (len (dig "k8s" "clusterDomain" "" .Values.global)) 0 }}
|
||||
{{- .Values.global.k8s.clusterDomain }}
|
||||
{{- else }}
|
||||
{{- .Values.clusterDomain }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
Reference in New Issue
Block a user