my-apps/charts/common/templates/spawner/_networkPolicy.tpl
2025-08-24 00:09:37 +03:00

20 lines
726 B
Smarty

{{/*
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 -}}