k8s/helm-charts/dashy/charts/common/templates/spawner/_networkPolicy.tpl

20 lines
726 B
Smarty
Raw Normal View History

2023-11-16 19:42:02 +10:00
{{/*
Renders the networkPolicy objects required by the chart.
*/}}
{{- define "tc.v1.common.spawner.networkpolicy" -}}
{{/* Generate named networkpolicy as required */}}
{{- range $name, $networkPolicy := .Values.networkPolicy -}}
{{- if $networkPolicy.enabled -}}
{{- $networkPolicyValues := $networkPolicy -}}
{{/* set the default nameOverride to the networkpolicy name */}}
{{- if not $networkPolicyValues.nameOverride -}}
{{- $_ := set $networkPolicyValues "nameOverride" $name -}}
{{- end -}}
{{- $_ := set $ "ObjectValues" (dict "networkPolicy" $networkPolicyValues) -}}
{{- include "tc.v1.common.class.networkpolicy" $ -}}
{{- end -}}
{{- end -}}
{{- end -}}