mirror of
https://github.com/nikdoof/helm-charts.git
synced 2025-12-23 06:39:23 +00:00
[common] Add common chart from KaH
This commit is contained in:
27
charts/common/templates/lib/chart/_annotations.tpl
Normal file
27
charts/common/templates/lib/chart/_annotations.tpl
Normal file
@@ -0,0 +1,27 @@
|
||||
{{/* Common annotations shared across objects */}}
|
||||
{{- define "common.annotations" -}}
|
||||
{{- with .Values.global.annotations }}
|
||||
{{- range $k, $v := . }}
|
||||
{{- $name := $k }}
|
||||
{{- $value := tpl $v $ }}
|
||||
{{ $name }}: {{ quote $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Determine the Pod annotations used in the controller */}}
|
||||
{{- define "common.podAnnotations" -}}
|
||||
{{- if .Values.podAnnotations -}}
|
||||
{{- tpl (toYaml .Values.podAnnotations) . | nindent 0 -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $configMapsFound := false -}}
|
||||
{{- range $name, $configmap := .Values.configmap -}}
|
||||
{{- if $configmap.enabled -}}
|
||||
{{- $configMapsFound = true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- if $configMapsFound -}}
|
||||
{{- printf "checksum/config: %v" (include ("common.configmap") . | sha256sum) | nindent 0 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
Reference in New Issue
Block a user