mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-03 16:37:04 +02:00
Co-authored-by: lab-assistant[bot] <180935599+lab-assistant[bot]@users.noreply.github.com>
19 lines
1,021 B
Smarty
19 lines
1,021 B
Smarty
{{/*
|
|
Renders the networkPolicy objects required by the chart.
|
|
*/}}
|
|
{{- define "bjw-s.common.render.networkpolicies" -}}
|
|
{{- $rootContext := $ -}}
|
|
|
|
{{- /* Generate networkPolicy as required */ -}}
|
|
{{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkpolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) -}}
|
|
{{- range $identifier := keys $enabledNetworkPolicies -}}
|
|
{{- /* Generate object from the raw persistence values */ -}}
|
|
{{- $networkPolicyObject := (include "bjw-s.common.lib.networkpolicy.getByIdentifier" (dict "rootContext" $rootContext "id" $identifier) | fromYaml) -}}
|
|
|
|
{{- /* Perform validations on the networkPolicy before rendering */ -}}
|
|
{{- include "bjw-s.common.lib.networkpolicy.validate" (dict "rootContext" $ "object" $networkPolicyObject) -}}
|
|
|
|
{{- /* Include the networkPolicy class */ -}}
|
|
{{- include "bjw-s.common.class.networkpolicy" (dict "rootContext" $ "object" $networkPolicyObject) | nindent 0 -}}
|
|
{{- end -}}
|
|
{{- end -}}
|