Skip to content

Commit c96910f

Browse files
committed
Use v1alpha2 manifests in the helm chart
1 parent 7cf4782 commit c96910f

File tree

8 files changed

+72
-60
lines changed

8 files changed

+72
-60
lines changed

hack/charts/cluster-api-operator/templates/bootstrap-conditions.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ metadata:
1010
"helm.sh/hook-weight": "1"
1111
name: capi-system
1212
---
13-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
13+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
1414
kind: CoreProvider
1515
metadata:
1616
name: cluster-api
1717
namespace: capi-system
1818
annotations:
1919
"helm.sh/hook": "post-install"
2020
"helm.sh/hook-weight": "2"
21-
{{- if .Values.secretName }}
21+
{{- with .Values.configSecret }}
2222
spec:
23-
secretName: {{ .Values.secretName }}
24-
{{- if .Values.secretNamespace }}
25-
secretNamespace: {{ .Values.secretNamespace }}
26-
{{- end }}
23+
configSecret:
24+
name: {{ .name }}
25+
{{- if .namespace }}
26+
namespace: {{ .namespace }}
27+
{{- end }}
2728
{{- end }}
2829
{{- end }}
2930
{{- end }}

hack/charts/cluster-api-operator/templates/bootstrap.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@ metadata:
3030
"helm.sh/hook-weight": "1"
3131
name: {{ $bootstrapNamespace }}
3232
---
33-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
33+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
3434
kind: BootstrapProvider
3535
metadata:
3636
name: {{ $bootstrapName }}
3737
namespace: {{ $bootstrapNamespace }}
3838
annotations:
3939
"helm.sh/hook": "post-install"
4040
"helm.sh/hook-weight": "2"
41-
{{- if or $bootstrapVersion $.Values.secretName }}
41+
{{- if or $bootstrapVersion .Values.configSecret.name }}
4242
spec:
4343
{{- end}}
4444
{{- if $bootstrapVersion }}
4545
version: {{ $bootstrapVersion }}
4646
{{- end }}
47-
{{- if $.Values.secretName }}
48-
secretName: {{ $.Values.secretName }}
49-
{{- end }}
50-
{{- if $.Values.secretNamespace }}
51-
secretNamespace: {{ $.Values.secretNamespace }}
47+
{{- if .Values.configSecret.name }}
48+
configSecret:
49+
name: {{ .Values.configSecret.name }}
50+
{{- if .Values.configSecret.namespace }}
51+
namespace: {{ .Values.configSecret.namespace }}
52+
{{- end }}
5253
{{- end }}
5354
{{- end }}
5455
{{- end }}

hack/charts/cluster-api-operator/templates/control-plane-conditions.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ metadata:
1010
"helm.sh/hook-weight": "1"
1111
name: capi-system
1212
---
13-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
13+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
1414
kind: CoreProvider
1515
metadata:
1616
name: cluster-api
1717
namespace: capi-system
1818
annotations:
1919
"helm.sh/hook": "post-install"
2020
"helm.sh/hook-weight": "2"
21-
{{- if .Values.secretName }}
21+
{{- with .Values.configSecret }}
2222
spec:
23-
secretName: {{ .Values.secretName }}
24-
{{- if .Values.secretNamespace }}
25-
secretNamespace: {{ .Values.secretNamespace }}
26-
{{- end }}
23+
configSecret:
24+
name: {{ .name }}
25+
{{- if .namespace }}
26+
namespace: {{ .namespace }}
27+
{{- end }}
2728
{{- end }}
2829
{{- end }}
2930
{{- end }}

hack/charts/cluster-api-operator/templates/control-plane.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@ metadata:
3030
"helm.sh/hook-weight": "1"
3131
name: {{ $controlPlaneNamespace }}
3232
---
33-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
33+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
3434
kind: ControlPlaneProvider
3535
metadata:
3636
name: {{ $controlPlaneName }}
3737
namespace: {{ $controlPlaneNamespace }}
3838
annotations:
3939
"helm.sh/hook": "post-install"
4040
"helm.sh/hook-weight": "2"
41-
{{- if or $controlPlaneVersion $.Values.secretName }}
41+
{{- if or $controlPlaneVersion $.Values.configSecret.name }}
4242
spec:
4343
{{- end}}
4444
{{- if $controlPlaneVersion }}
4545
version: {{ $controlPlaneVersion }}
4646
{{- end }}
47-
{{- if $.Values.secretName }}
48-
secretName: {{ $.Values.secretName }}
49-
{{- end }}
50-
{{- if $.Values.secretNamespace }}
51-
secretNamespace: {{ $.Values.secretNamespace }}
47+
{{- if $.Values.configSecret.name }}
48+
configSecret:
49+
name: {{ $.Values.configSecret.name }}
50+
{{- if $.Values.configSecret.namespace }}
51+
namespace: {{ $.Values.configSecret.namespace }}
52+
{{- end }}
5253
{{- end }}
5354
{{- end }}
5455
{{- end }}

hack/charts/cluster-api-operator/templates/core.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,25 @@ metadata:
2929
"helm.sh/hook-weight": "1"
3030
name: {{ $coreNamespace }}
3131
---
32-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
32+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
3333
kind: CoreProvider
3434
metadata:
3535
name: {{ $coreName }}
3636
namespace: {{ $coreNamespace }}
3737
annotations:
3838
"helm.sh/hook": "post-install"
3939
"helm.sh/hook-weight": "2"
40-
{{- if or $coreVersion .Values.secretName }}
40+
{{- if or $coreVersion $.Values.configSecret.name }}
4141
spec:
4242
{{- end}}
4343
{{- if $coreVersion }}
4444
version: {{ $coreVersion }}
4545
{{- end }}
46-
{{- if .Values.secretName }}
47-
secretName: {{ .Values.secretName }}
48-
{{- end }}
49-
{{- if .Values.secretNamespace }}
50-
secretNamespace: {{ .Values.secretNamespace }}
46+
{{- if $.Values.configSecret.name }}
47+
configSecret:
48+
name: {{ $.Values.configSecret.name }}
49+
{{- if $.Values.configSecret.namespace }}
50+
namespace: {{ $.Values.configSecret.namespace }}
51+
{{- end }}
5152
{{- end }}
5253
{{- end }}
Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{{- if .Values.infrastructure }}
2+
23
# Deploy core, bootstrap, and infrastructure components if not specified
34
{{- if not .Values.core }}
45
---
@@ -10,22 +11,24 @@ metadata:
1011
"helm.sh/hook-weight": "1"
1112
name: capi-system
1213
---
13-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
14+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
1415
kind: CoreProvider
1516
metadata:
1617
name: cluster-api
1718
namespace: capi-system
1819
annotations:
1920
"helm.sh/hook": "post-install"
2021
"helm.sh/hook-weight": "2"
21-
{{- if .Values.secretName }}
22+
{{- with .Values.configSecret }}
2223
spec:
23-
secretName: {{ .Values.secretName }}
24-
{{- if .Values.secretNamespace }}
25-
secretNamespace: {{ .Values.secretNamespace }}
26-
{{- end }}
24+
configSecret:
25+
name: {{ .name }}
26+
{{- if .namespace }}
27+
namespace: {{ .namespace }}
28+
{{- end }}
2729
{{- end }}
2830
{{- end }}
31+
2932
{{- if not .Values.bootstrap }}
3033
---
3134
apiVersion: v1
@@ -36,22 +39,24 @@ metadata:
3639
"helm.sh/hook-weight": "1"
3740
name: capi-kubeadm-bootstrap-system
3841
---
39-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
42+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
4043
kind: BootstrapProvider
4144
metadata:
4245
name: kubeadm
4346
namespace: capi-kubeadm-bootstrap-system
4447
annotations:
4548
"helm.sh/hook": "post-install"
4649
"helm.sh/hook-weight": "2"
47-
{{- if .Values.secretName }}
50+
{{- with .Values.configSecret }}
4851
spec:
49-
secretName: {{ .Values.secretName }}
50-
{{- if .Values.secretNamespace }}
51-
secretNamespace: {{ .Values.secretNamespace }}
52-
{{- end }}
52+
configSecret:
53+
name: {{ .name }}
54+
{{- if .namespace }}
55+
namespace: {{ .namespace }}
56+
{{- end }}
5357
{{- end }}
5458
{{- end }}
59+
5560
{{- if not .Values.controlPlane }}
5661
---
5762
apiVersion: v1
@@ -62,20 +67,22 @@ metadata:
6267
"helm.sh/hook-weight": "1"
6368
name: capi-kubeadm-control-plane-system
6469
---
65-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
70+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
6671
kind: ControlPlaneProvider
6772
metadata:
6873
name: kubeadm
6974
namespace: capi-kubeadm-control-plane-system
7075
annotations:
7176
"helm.sh/hook": "post-install"
7277
"helm.sh/hook-weight": "2"
73-
{{- if .Values.secretName }}
78+
{{- with .Values.configSecret }}
7479
spec:
75-
secretName: {{ .Values.secretName }}
76-
{{- if .Values.secretNamespace }}
77-
secretNamespace: {{ .Values.secretNamespace }}
78-
{{- end }}
80+
configSecret:
81+
name: {{ .name }}
82+
{{- if .namespace }}
83+
namespace: {{ .namespace }}
84+
{{- end }}
7985
{{- end }}
8086
{{- end }}
87+
8188
{{- end }}

hack/charts/cluster-api-operator/templates/infra.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,25 +30,26 @@ metadata:
3030
"helm.sh/hook-weight": "1"
3131
name: {{ $infrastructureNamespace }}
3232
---
33-
apiVersion: operator.cluster.x-k8s.io/v1alpha1
33+
apiVersion: operator.cluster.x-k8s.io/v1alpha2
3434
kind: InfrastructureProvider
3535
metadata:
3636
name: {{ $infrastructureName }}
3737
namespace: {{ $infrastructureNamespace }}
3838
annotations:
3939
"helm.sh/hook": "post-install"
4040
"helm.sh/hook-weight": "2"
41-
{{- if or $infrastructureVersion $.Values.secretName }}
41+
{{- if or $infrastructureVersion $.Values.configSecret.name }}
4242
spec:
4343
{{- end }}
4444
{{- if $infrastructureVersion }}
4545
version: {{ $infrastructureVersion }}
4646
{{- end }}
47-
{{- if $.Values.secretName }}
48-
secretName: {{ $.Values.secretName }}
49-
{{- end }}
50-
{{- if $.Values.secretNamespace }}
51-
secretNamespace: {{ $.Values.secretNamespace }}
47+
{{- if $.Values.configSecret.name }}
48+
configSecret:
49+
name: {{ $.Values.configSecret.name }}
50+
{{- if $.Values.configSecret.namespace }}
51+
namespace: {{ $.Values.configSecret.namespace }}
52+
{{- end }}
5253
{{- end }}
5354
{{- end }}
5455
{{- end }}

hack/charts/cluster-api-operator/values.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@ controlPlane: ""
1313
infrastructure: ""
1414
# ---
1515
# Common configuration secret options
16-
secretName: ""
17-
secretNamespace: ""
16+
configSecret: {}
1817
# ---
1918
# CAPI operator deployment options
2019
logLevel: 2

0 commit comments

Comments
 (0)