refactor: use a helper function for printing out both labels and annotations

This commit is contained in:
Jose Diaz-Gonzalez committed 2024-03-01 17:42:24 -05:00
1 parent 065d4ef828
commit 7a5bd7ee0f
12 files changed
+82 -105

No files matched your search

@@ -0,0 +1,17 @@
{{- define "print.annotations" }}
{{- if and .config.annotations (hasKey .config.annotations .key) }}
{{- $annotations := get .config.annotations .key }}
{{- range $k, $v := $annotations }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}
{{- define "print.labels" }}
{{- if and .config.labels (hasKey .config.labels .key) }}
{{- $labels := get .config.labels .key }}
{{- range $k, $v := $labels }}
{{ $k }}: {{ $v | quote }}
{{- end }}
{{- end }}
{{- end }}