new way of doin
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
root
2023-11-16 19:42:02 +10:00
parent 77ec717184
commit 1eaf295724
341 changed files with 19416 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
{{/* Secret Validation */}}
{{/* Call this template:
{{ include "tc.v1.common.lib.secret.validation" (dict "objectData" $objectData) -}}
objectData:
labels: The labels of the secret.
annotations: The annotations of the secret.
data: The data of the secret.
*/}}
{{- define "tc.v1.common.lib.secret.validation" -}}
{{- $objectData := .objectData -}}
{{- if and ( not $objectData.data ) ( not $objectData.stringData ) -}}
{{- fail "Secret - Expected non-empty <data> or <stringData>" -}}
{{- end -}}
{{- if and $objectData.data (not (kindIs "map" $objectData.data)) -}}
{{- fail (printf "Secret - Expected <data> to be a dictionary, but got [%v]" (kindOf $objectData.data)) -}}
{{- end -}}
{{- if and (hasKey $objectData "type") (not $objectData.type) -}}
{{- fail (printf "Secret - Found <type> key, but it's empty") -}}
{{- end -}}
{{- end -}}