File tree 6 files changed +25
-35
lines changed
hack/charts/cluster-api-operator/templates
6 files changed +25
-35
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
22
22
{ {- end -} }
23
23
{ {- end -} }
24
24
{ {- 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 @@ -26,18 +26,14 @@ metadata:
26
26
" helm.sh/hook-weight " : " 2"
27
27
{{- end }}
28
28
" argocd.argoproj.io/sync-wave " : " 2"
29
- {{- if or $bootstrapVersion $.Values.configSecret.name }}
29
+ {{- if or $bootstrapVersion $.Values.configSecret.name (($bootstrap).configSecret).name }}
30
30
spec :
31
31
{{- end}}
32
32
{{- if $bootstrapVersion }}
33
33
version : {{ $bootstrapVersion }}
34
34
{{- end }}
35
- {{- if $.Values.configSecret.name }}
36
- configSecret :
37
- name : {{ $.Values.configSecret.name }}
38
- {{- if $.Values.configSecret.namespace }}
39
- namespace : {{ $.Values.configSecret.namespace }}
40
- {{- end }}
35
+ {{- if (default (($bootstrap).configSecret).name (($.Values).configSecret).name) }}
36
+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $bootstrap) | nindent 2 }}
41
37
{{- end }}
42
38
{{- if $bootstrap.manifestPatches }}
43
39
manifestPatches : {{ toYaml $bootstrap.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ metadata:
26
26
" helm.sh/hook-weight " : " 2"
27
27
{{- end }}
28
28
" argocd.argoproj.io/sync-wave " : " 2"
29
- {{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager }}
29
+ {{- if or $controlPlaneVersion $.Values.configSecret.name $.Values.manager (($controlPlane).configSecret).name }}
30
30
spec :
31
31
{{- end}}
32
32
{{- if $controlPlaneVersion }}
45
45
{{- end }}
46
46
{{- end }}
47
47
{{- end }}
48
- {{- if $.Values.configSecret.name }}
49
- configSecret :
50
- name : {{ $.Values.configSecret.name }}
51
- {{- if $.Values.configSecret.namespace }}
52
- namespace : {{ $.Values.configSecret.namespace }}
53
- {{- end }}
48
+ {{- if (default (($controlPlane).configSecret).name (($.Values).configSecret).name) }}
49
+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $controlPlane) | nindent 2 }}
54
50
{{- end }}
55
51
{{- if $controlPlane.manifestPatches }}
56
52
manifestPatches : {{ toYaml $controlPlane.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ metadata:
26
26
" helm.sh/hook-weight " : " 2"
27
27
{{- end }}
28
28
" argocd.argoproj.io/sync-wave " : " 2"
29
- {{- if or $coreVersion $.Values.configSecret.name $.Values.manager }}
29
+ {{- if or $coreVersion $.Values.configSecret.name $.Values.manager (($core).configSecret).name }}
30
30
spec :
31
31
{{- end}}
32
32
{{- if $coreVersion }}
41
41
{{- end }}
42
42
{{- end }}
43
43
{{- end }}
44
- {{- if $.Values.configSecret.name }}
45
- configSecret :
46
- name : {{ $.Values.configSecret.name }}
47
- {{- if $.Values.configSecret.namespace }}
48
- namespace : {{ $.Values.configSecret.namespace }}
49
- {{- end }}
44
+ {{- if (default (($core).configSecret).name (($.Values).configSecret).name) }}
45
+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $core) | nindent 2 }}
50
46
{{- end }}
51
47
{{- if $core.manifestPatches }}
52
48
manifestPatches : {{ toYaml $core.manifestPatches | nindent 4 }}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ metadata:
26
26
" helm.sh/hook-weight " : " 2"
27
27
{{- end }}
28
28
" argocd.argoproj.io/sync-wave " : " 2"
29
- {{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }}
29
+ {{- if or $infrastructureVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($infra).configSecret).name }}
30
30
spec :
31
31
{{- end }}
32
32
{{- if $infrastructureVersion }}
55
55
{{- end }}
56
56
{{- end }}
57
57
{{- end }}
58
- {{- if $.Values.configSecret.name }}
59
- configSecret :
60
- name : {{ $.Values.configSecret.name }}
61
- {{- if $.Values.configSecret.namespace }}
62
- namespace : {{ $.Values.configSecret.namespace }}
63
- {{- end }}
58
+ {{- if (default (($infra).configSecret).name (($.Values).configSecret).name) }}
59
+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $infra) | nindent 2 }}
64
60
{{- end }}
65
61
{{- if $.Values.additionalDeployments }}
66
62
additionalDeployments : {{ toYaml $.Values.additionalDeployments | nindent 4 }}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ metadata:
26
26
" helm.sh/hook-weight " : " 2"
27
27
{{- end }}
28
28
" argocd.argoproj.io/sync-wave " : " 2"
29
- {{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments }}
29
+ {{- if or $ipamVersion $.Values.configSecret.name $.Values.manager $.Values.additionalDeployments (($ipam).configSecret).name }}
30
30
spec :
31
31
{{- end }}
32
32
{{- if $ipamVersion }}
45
45
{{- end }}
46
46
{{- end }}
47
47
{{- end }}
48
- {{- if $.Values.configSecret.name }}
49
- configSecret :
50
- name : {{ $.Values.configSecret.name }}
51
- {{- if $.Values.configSecret.namespace }}
52
- namespace : {{ $.Values.configSecret.namespace }}
53
- {{- end }}
48
+ {{- if (default (($ipam).configSecret).name (($.Values).configSecret).name) }}
49
+ {{- include "capi-operator.configSecret" (dict "ROOT" $ "ARGUMENT" $ipam) | nindent 2 }}
54
50
{{- end }}
55
51
{{- if $ipam.manifestPatches }}
56
52
manifestPatches : {{ toYaml $ipam.manifestPatches | nindent 4 }}
You can’t perform that action at this time.
0 commit comments