helm-charts/charts/library/common/templates/lib/container/_validate.tpl
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs b360c9885a
feat(common): Release v2.1.0 (#221)
Co-authored-by: Christopher Larivière <lariviere.c@gmail.com>
2023-11-10 15:46:55 +01:00

20 lines
955 B
Smarty

{{/*
Validate container values
*/}}
{{- define "bjw-s.common.lib.container.validate" -}}
{{- $rootContext := .rootContext -}}
{{- $controllerObject := .controllerObject -}}
{{- $containerObject := .containerObject -}}
{{- if not (kindIs "map" $containerObject.image) -}}
{{- fail (printf "Image required to be a dictionary with repository and tag fields. (controller %s, container %s)" $controllerObject.identifier $containerObject.identifier) }}
{{- end -}}
{{- if empty (dig "image" "repository" nil $containerObject) -}}
{{- fail (printf "No image repository specified for container. (controller %s, container %s)" $controllerObject.identifier $containerObject.identifier) }}
{{- end -}}
{{- if empty (dig "image" "tag" nil $containerObject) -}}
{{- fail (printf "No image tag specified for container. (controller %s, container %s)" $controllerObject.identifier $containerObject.identifier) }}
{{- end -}}
{{- end -}}