_validation.tpl 651 B

123456789101112131415161718
  1. {{/* Certificate Validation */}}
  2. {{/* Call this template:
  3. {{ include "ix.v1.common.lib.certificate.validation" (dict "objectData" $objectData) -}}
  4. objectData: The object data of the certificate.
  5. */}}
  6. {{- define "ix.v1.common.lib.certificate.validation" -}}
  7. {{- $objectData := .objectData -}}
  8. {{- if not $objectData.id -}}
  9. {{- fail "Certificate - Expected non-empty <id>" -}}
  10. {{- end -}}
  11. {{- if and $objectData.targetSelector (not (kindIs "map" $objectData.targetSelector)) -}}
  12. {{- fail (printf "Certificate - Expected <targetSelector> to be a [map], but got [%s]" (kindOf $objectData.targetSelector)) -}}
  13. {{- end -}}
  14. {{- end -}}