UNCLASSIFIED - NO CUI

Skip to content
Snippets Groups Projects
Commit cfcc7e02 authored by Andrew Kesterson's avatar Andrew Kesterson Committed by Michael Martin
Browse files

#1993 : Pass big bang values through to package charts

parent 604fe512
No related branches found
No related tags found
1 merge request!4263#1993 : Pass big bang values through to package charts
{{- define "values-bigbang" -}}
{{- /*
* bigbang.values-bigbang: Produce a stripped version of the bigbang variables
* in the root namespace suitable for inclusion in wrapper or package variables definitions
*/ -}}
{{ toYaml (pick $ "domain" "openshift") }}
{{- /* For every top level map, if it has the enable key, pass it through. */ -}}
{{- range $bbpkg, $bbvals := $ -}}
{{- if kindIs "map" $bbvals -}}
{{- if hasKey $bbvals "enabled" }}
{{ $bbpkg }}:
{{- /* For network policies, we need all of its values. */ -}}
{{- if eq $bbpkg "networkPolicies" -}}
{{- toYaml $bbvals | nindent 2}}
{{- else }}
enabled: {{ $bbvals.enabled }}
{{- end -}}
{{- /* For addons, pass through the enable key. */ -}}
{{- else if eq $bbpkg "addons" }}
{{ $bbpkg }}:
{{- range $addpkg, $addvals := $bbvals -}}
{{- if hasKey $addvals "enabled" }}
{{ $addpkg }}:
enabled: {{ $addvals.enabled }}
{{- /* For authservice, the selector values are needed. */ -}}
{{- if and (eq $addpkg "authservice") (or (dig "values" "selector" "key" false $addvals) (dig "values" "selector" "value" false $addvals)) }}
values:
selector:
{{- if (dig "values" "selector" "key" false $addvals) }}
key: {{ $addvals.values.selector.key }}
{{- end -}}
{{- if (dig "values" "selector" "value" false $addvals) }}
value: {{ $addvals.values.selector.key }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end }}
{{- define "imagePullSecret" }}
{{- if .Values.registryCredentials -}}
{{- $credType := typeOf .Values.registryCredentials -}}
......@@ -394,3 +436,5 @@ data:
{{- end -}}
{{- end -}}
{{- end -}}
......@@ -17,6 +17,8 @@ type: Opaque
stringData:
{{ if and (dig "enabled" true $vals) (not $vals.kustomize) -}}
values.yaml: |
bigbang:
{{- include "values-bigbang" $.Values | nindent 6 }}
{{- tpl (toYaml $vals.values) $ | nindent 4 }}
{{ else }}
{{- tpl (toYaml $vals.values) $ | nindent 2 }}
......
......@@ -19,41 +19,7 @@ stringData:
{{- tpl (toYaml (omit $merged.package "git" "helmRepo" "flux" "postRenderers" "dependsOn")) $ | nindent 6 }}
{{- end }}
bigbang:
{{- toYaml (pick $merged.bigbang "domain" "openshift") | nindent 6 -}}
{{- /* For every top level map, if it has the enable key, pass it through. */ -}}
{{- range $bbpkg, $bbvals := $merged.bigbang -}}
{{- if kindIs "map" $bbvals -}}
{{- if hasKey $bbvals "enabled" -}}
{{- $bbpkg | nindent 6 -}}:
{{- /* For network policies, we need all of its values. */ -}}
{{- if eq $bbpkg "networkPolicies" -}}
{{- toYaml $bbvals | nindent 8 -}}
{{- else }}
enabled: {{ $bbvals.enabled }}
{{- end -}}
{{- /* For addons, pass through the enable key. */ -}}
{{- else if eq $bbpkg "addons" -}}
{{- $bbpkg | nindent 6 -}}:
{{- range $addpkg, $addvals := $bbvals -}}
{{- if hasKey $addvals "enabled" -}}
{{- $addpkg | nindent 8 }}:
enabled: {{ $addvals.enabled }}
{{- /* For authservice, the selector values are needed. */ -}}
{{- if and (eq $addpkg "authservice") (or (dig "values" "selector" "key" false $addvals) (dig "values" "selector" "value" false $addvals)) }}
values:
selector:
{{- if (dig "values" "selector" "key" false $addvals) -}}
key: {{ $addvals.values.selector.key }}
{{- end -}}
{{- if (dig "values" "selector" "value" false $addvals) -}}
value: {{ $addvals.values.selector.key }}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end }}
{{- include "values-bigbang" $merged.bigbang | nindent 6 }}
---
{{ end -}}
{{- end -}}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment