File tree Expand file tree Collapse file tree 7 files changed +29
-36
lines changed
hack/charts/cluster-api-operator/templates Expand file tree Collapse file tree 7 files changed +29
-36
lines changed Original file line number Diff line number Diff line change @@ -22,3 +22,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
2222{ {- end -} }
2323{ {- end -} }
2424{ {- end -} }
25+
26+ { {- define " capi-operator.configSecret" -} }
27+ { {- $ := .ROOT -} }
28+ { {- $arg := .ARGUMENT -} }
29+ configSecret:
30+ name: { { default (($arg ).configSecret).name (($.Values).configSecret).name } }
31+ { {- if (default (($arg ).configSecret).namespace (($.Values).configSecret).namespace) } }
32+ namespace: { { default (($arg ).configSecret).namespace (($.Values).configSecret).namespace } }
33+ { {- end } }
34+ { {- end -} }
Original file line number Diff line number Diff line change @@ -28,12 +28,15 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $addonVersion $.Values.secretName }}
31+ {{- if or $addonVersion $.Values.secretName $.Values.configSecret.name (($addon).configSecret).name }}
3232spec :
3333{{- end}}
3434{{- if $addonVersion }}
3535 version : {{ $addonVersion }}
3636{{- end }}
37+ {{- if (default (($addon).configSecret).name (($.Values).configSecret).name) }}
38+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $addon) | nindent 2 }}
39+ {{- end }}
3740{{- if $.Values.secretName }}
3841 secretName : {{ $.Values.secretName }}
3942{{- end }}
Original file line number Diff line number Diff line change @@ -28,18 +28,14 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $bootstrapVersion $.Values.configSecret.name }}
31+ {{- if or $bootstrapVersion $.Values.configSecret.name (($bootstrap).configSecret).name }}
3232spec :
3333{{- end}}
3434{{- if $bootstrapVersion }}
3535 version : {{ $bootstrapVersion }}
3636{{- end }}
37- {{- if $.Values.configSecret.name }}
38- configSecret :
39- name : {{ $.Values.configSecret.name }}
40- {{- if $.Values.configSecret.namespace }}
41- namespace : {{ $.Values.configSecret.namespace }}
42- {{- end }}
37+ {{- if (default (($bootstrap).configSecret).name (($.Values).configSecret).name) }}
38+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $bootstrap) | nindent 2 }}
4339{{- end }}
4440{{- if $bootstrap.manifestPatches }}
4541 manifestPatches : {{ toYaml $bootstrap.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager }}
31+ {{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager (($controlPlane).configSecret).name }}
3232spec :
3333{{- end}}
3434{{- if $controlPlaneVersion }}
4747{{- end }}
4848{{- end }}
4949{{- end }}
50- {{- if $.Values.configSecret.name }}
51- configSecret :
52- name : {{ $.Values.configSecret.name }}
53- {{- if $.Values.configSecret.namespace }}
54- namespace : {{ $.Values.configSecret.namespace }}
55- {{- end }}
50+ {{- if (default (($controlPlane).configSecret).name (($.Values).configSecret).name) }}
51+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $controlPlane) | nindent 2 }}
5652{{- end }}
5753{{- if $controlPlane.manifestPatches }}
5854 manifestPatches : {{ toYaml $controlPlane.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $coreVersion $.Values.configSecret.name $.Values.manager }}
31+ {{- if or $coreVersion $.Values.configSecret.name $.Values.manager (($core).configSecret).name }}
3232spec :
3333{{- end}}
3434{{- if $coreVersion }}
4343 {{- end }}
4444{{- end }}
4545{{- end }}
46- {{- if $.Values.configSecret.name }}
47- configSecret :
48- name : {{ $.Values.configSecret.name }}
49- {{- if $.Values.configSecret.namespace }}
50- namespace : {{ $.Values.configSecret.namespace }}
51- {{- end }}
46+ {{- if (default (($core).configSecret).name (($.Values).configSecret).name) }}
47+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $core) | nindent 2 }}
5248{{- end }}
5349{{- if $core.manifestPatches }}
5450 manifestPatches : {{ toYaml $core.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }}
31+ {{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($infra).configSecret).name }}
3232spec :
3333{{- end }}
3434{{- if $infrastructureVersion }}
5757 {{- end }}
5858{{- end }}
5959{{- end }}
60- {{- if $.Values.configSecret.name }}
61- configSecret :
62- name : {{ $.Values.configSecret.name }}
63- {{- if $.Values.configSecret.namespace }}
64- namespace : {{ $.Values.configSecret.namespace }}
65- {{- end }}
60+ {{- if (default (($infra).configSecret).name (($.Values).configSecret).name) }}
61+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $infra) | nindent 2 }}
6662{{- end }}
6763{{- if $.Values.additionalDeployments }}
6864 additionalDeployments : {{ toYaml $.Values.additionalDeployments | nindent 4 }}
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ metadata:
2828 " helm.sh/hook-weight " : " 2"
2929 {{- end }}
3030 " argocd.argoproj.io/sync-wave " : " 2"
31- {{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }}
31+ {{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($ipam).configSecret).name }}
3232spec :
3333{{- end }}
3434{{- if $ipamVersion }}
5757 {{- end }}
5858{{- end }}
5959{{- end }}
60- {{- if $.Values.configSecret.name }}
61- configSecret :
62- name : {{ $.Values.configSecret.name }}
63- {{- if $.Values.configSecret.namespace }}
64- namespace : {{ $.Values.configSecret.namespace }}
65- {{- end }}
60+ {{- if (default (($ipam).configSecret).name (($.Values).configSecret).name) }}
61+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $ipam) | nindent 2 }}
6662{{- end }}
6763{{- if $ipam.manifestPatches }}
6864 manifestPatches : {{ toYaml $ipam.manifestPatches | nindent 4 }}
You can’t perform that action at this time.
0 commit comments