mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common): Release v2.2.0 (#223)
This commit is contained in:
parent
8b21e9f6c7
commit
8bfc33eb8a
11 changed files with 244 additions and 47 deletions
|
@ -0,0 +1,17 @@
|
|||
{{/*
|
||||
Returns the items in a map that have a certain key
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.getMapItemsWithKey" -}}
|
||||
{{- $map := .map -}}
|
||||
{{- $keyToFind := .key -}}
|
||||
{{- $output := dict -}}
|
||||
|
||||
{{- if not (empty $keyToFind) -}}
|
||||
{{- range $key, $item := $map -}}
|
||||
{{- if not (empty (dig $keyToFind nil $item)) -}}
|
||||
{{- $_ := set $output $key $item -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $output | toYaml -}}
|
||||
{{- end }}
|
Loading…
Add table
Add a link
Reference in a new issue