mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 08:57:04 +02:00
feat(common): Release 2.0.0-beta.2 (#176)
This commit is contained in:
parent
ed407c00df
commit
9928235b84
80 changed files with 1306 additions and 161 deletions
26
charts/library/common/templates/render/_networkpolicies.tpl
Normal file
26
charts/library/common/templates/render/_networkpolicies.tpl
Normal file
|
@ -0,0 +1,26 @@
|
|||
{{/*
|
||||
Renders the networkPolicy objects required by the chart.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.render.networkpolicies" -}}
|
||||
{{- /* Generate named networkPolicy as required */ -}}
|
||||
{{- range $key, $networkPolicy := .Values.networkpolicies }}
|
||||
{{- /* Enable networkPolicy by default, but allow override */ -}}
|
||||
{{- $networkPolicyEnabled := true -}}
|
||||
{{- if hasKey $networkPolicy "enabled" -}}
|
||||
{{- $networkPolicyEnabled = $networkPolicy.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $networkPolicyEnabled -}}
|
||||
{{- $networkPolicyValues := (mustDeepCopy $networkPolicy) -}}
|
||||
|
||||
{{- /* Create object from the raw networkPolicy values */ -}}
|
||||
{{- $networkPolicyObject := (include "bjw-s.common.lib.networkpolicy.valuesToObject" (dict "rootContext" $ "id" $key "values" $networkPolicyValues)) | 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 -}}
|
||||
{{- end -}}
|
Loading…
Add table
Add a link
Reference in a new issue