mirror of
https://github.com/bjw-s-labs/helm-charts.git
synced 2025-07-04 00:47:04 +02:00
feat(common)!: Release v3.0.0-beta2 (#280)
This commit is contained in:
parent
23ae8131da
commit
21e751bc16
51 changed files with 419 additions and 368 deletions
|
@ -0,0 +1,23 @@
|
|||
{{/*
|
||||
Return the enabled NetworkPolicies.
|
||||
*/}}
|
||||
{{- define "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" -}}
|
||||
{{- $rootContext := .rootContext -}}
|
||||
{{- $enabledNetworkPolicies := dict -}}
|
||||
|
||||
{{- range $name, $networkPolicy := $rootContext.Values.networkPolicy -}}
|
||||
{{- if kindIs "map" $networkPolicy -}}
|
||||
{{- /* Enable by default, but allow override */ -}}
|
||||
{{- $networkPolicyEnabled := true -}}
|
||||
{{- if hasKey $networkPolicy "enabled" -}}
|
||||
{{- $networkPolicyEnabled = $networkPolicy.enabled -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if $networkPolicyEnabled -}}
|
||||
{{- $_ := set $enabledNetworkPolicies $name . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $enabledNetworkPolicies | toYaml -}}
|
||||
{{- end -}}
|
|
@ -12,7 +12,8 @@ Convert networkPolicy values to an object
|
|||
{{- if $objectValues.nameOverride -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $objectValues.nameOverride -}}
|
||||
{{- else -}}
|
||||
{{- if ne $identifier "main" -}}
|
||||
{{- $enabledNetworkPolicies := (include "bjw-s.common.lib.networkPolicy.enabledNetworkPolicies" (dict "rootContext" $rootContext) | fromYaml ) }}
|
||||
{{- if gt (len $enabledNetworkPolicies) 1 -}}
|
||||
{{- $objectName = printf "%s-%s" $objectName $identifier -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue