k8s/helm-charts/dashy/charts/common/templates/lib/endpointSlice/_endpoints.tpl
root 1eaf295724
Some checks failed
continuous-integration/drone/push Build is failing
new way of doin
2023-11-16 19:42:02 +10:00

22 lines
839 B
Smarty

{{/* EndpointSlice - endpoints */}}
{{/* Call this template:
{{ include "tc.v1.common.lib.endpointslice.endpoints" (dict "rootCtx" $rootCtx "objectData" $objectData) -}}
rootCtx: The root context of the chart.
objectData: The object data of the service
*/}}
{{- define "tc.v1.common.lib.endpointslice.endpoints" -}}
{{- $rootCtx := .rootCtx -}}
{{- $objectData := .objectData -}}
{{- if not $objectData.externalIP -}}
{{- fail "EndpointSlice - Expected non-empty <externalIP>" -}}
{{- end -}}
{{- if not (kindIs "string" $objectData.externalIP) -}} {{/* Only single IP is supported currently on this lib */}}
{{- fail (printf "EndpointSlice - Expected <externalIP> to be a [string], but got [%s]" (kindOf $objectData.externalIP)) -}}
{{- end }}
- addresses:
- {{ tpl $objectData.externalIP $rootCtx }}
{{- end -}}