Skip to content

Commit 33a3f06

Browse files
authored
✨ update CAPI to 1.8.1 (#212)
**What is the purpose of this pull request/Why do we need it?** Updates CAPI version **Description of changes:** * sigs.k8s.io/cluster-api 1.7.4 => 1.8.1 * sigs.k8s.io/cluster-api/test 1.7.4 => 1.8.1 * k8s.io/api 0.29.7 => 0.30.3 * k8s.io/apimachinery 0.29.7 => 0.30.3 * k8s.io/client-go 0.29.7 => 0.30.3 * sigs.k8s.io/controller-runtime 0.17.5 => 0.18.5 **Special notes for your reviewer:** **Checklist:** - [x] Documentation updated - [x] E2E Tests updated - [x] Includes [emojis](https://github.com/kubernetes-sigs/kubebuilder-release-tools?tab=readme-ov-file#kubebuilder-project-versioning)
1 parent 0c67905 commit 33a3f06

22 files changed

+309
-240
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ envfile
3131

3232
# editor and IDE paraphernalia
3333
.idea
34+
.run
3435
.vscode
3536
*.swp
3637
*.swo

.golangci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ linters-settings:
9797
allow:
9898
- error
9999
- generic
100-
- "github.com/ionos-cloud/cluster-api-provider-ionoscloud/internal/ionoscloud.Client"
100+
- ionoscloud.Client
101+
- bootstrap.ClusterProvider
102+
- framework.ClusterProxy
101103
loggercheck:
102104
require-string-key: true
103105
no-printf-like: true
@@ -199,6 +201,8 @@ issues:
199201
- mock*
200202

201203
run:
204+
build-tags:
205+
- e2e
202206
timeout: 10m
203207
allow-parallel-runners: true
204208
go: "1.22"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
178178

179179
## Tool Versions
180180
KUSTOMIZE_VERSION ?= v5.1.1
181-
CONTROLLER_TOOLS_VERSION ?= v0.14.0
181+
CONTROLLER_TOOLS_VERSION ?= v0.16.1
182182

183183
.PHONY: kustomize
184184
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ If you need help with CAPIC, please visit the [#cluster-api-ionoscloud][slack] c
4343

4444
This provider's versions are compatible with the following versions of Cluster API:
4545

46-
| | Cluster API v1beta1 (v1.7) |
47-
|------------------------|:--------------------------:|
48-
| CAPIC v1alpha1 (v0.2) ||
49-
| CAPIC v1alpha1 (v0.3) ||
50-
| CAPIC v1alpha1 (v0.4) ||
46+
| | Cluster API v1beta1 (v1.7) | Cluster API v1beta1 (v1.8) |
47+
|------------------------|:--------------------------:|:--------------------------:|
48+
| CAPIC v1alpha1 (v0.2) |||
49+
| CAPIC v1alpha1 (v0.3) |||
50+
| CAPIC v1alpha1 (v0.4) |||
5151

5252
### Kubernetes Versions
5353

cmd/main.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var (
4242
setupLog = ctrl.Log.WithName("setup")
4343
healthProbeAddr string
4444
enableLeaderElection bool
45-
diagnosticOptions = flags.DiagnosticsOptions{}
45+
managerOptions = flags.ManagerOptions{}
4646

4747
icClusterConcurrency int
4848
icMachineConcurrency int
@@ -65,9 +65,15 @@ func main() {
6565
initFlags()
6666
pflag.Parse()
6767

68+
_, metricsOptions, err := flags.GetManagerOptions(managerOptions)
69+
if err != nil {
70+
setupLog.Error(err, "unable to get manager options")
71+
os.Exit(1)
72+
}
73+
6874
mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
6975
Scheme: scheme,
70-
Metrics: flags.GetDiagnosticsOptions(diagnosticOptions),
76+
Metrics: *metricsOptions,
7177
HealthProbeBindAddress: healthProbeAddr,
7278
LeaderElection: enableLeaderElection,
7379
LeaderElectionID: "15f3d3ca.cluster.x-k8s.io",
@@ -127,7 +133,7 @@ func main() {
127133
func initFlags() {
128134
klog.InitFlags(nil)
129135
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
130-
flags.AddDiagnosticsOptions(pflag.CommandLine, &diagnosticOptions)
136+
flags.AddManagerOptions(pflag.CommandLine, &managerOptions)
131137
pflag.StringVar(&healthProbeAddr, "health-probe-bind-address", ":8081",
132138
"The address the probe endpoint binds to.")
133139
pflag.BoolVar(&enableLeaderElection, "leader-elect", false,

config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudclusters.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: ionoscloudclusters.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -61,8 +61,6 @@ spec:
6161
description: |-
6262
ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
6363
64-
65-
TODO(gfariasalves): as of now, IP must be provided by the user as we still don't insert the
6664
provider-provided block IP into the kube-vip manifest.
6765
properties:
6866
host:
@@ -85,10 +83,13 @@ spec:
8583
the credentials to access the IONOS Cloud API.
8684
properties:
8785
name:
86+
default: ""
8887
description: |-
8988
Name of the referent.
89+
This field is effectively required, but due to backwards compatibility is
90+
allowed to be empty. Instances of this type with an empty value here are
91+
almost certainly wrong.
9092
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
91-
TODO: Add other useful fields. apiVersion, kind, uid?
9293
type: string
9394
type: object
9495
x-kubernetes-map-type: atomic
@@ -101,10 +102,13 @@ spec:
101102
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
102103
properties:
103104
name:
105+
default: ""
104106
description: |-
105107
Name of the referent.
108+
This field is effectively required, but due to backwards compatibility is
109+
allowed to be empty. Instances of this type with an empty value here are
110+
almost certainly wrong.
106111
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
107-
TODO: Add other useful fields. apiVersion, kind, uid?
108112
type: string
109113
type: object
110114
x-kubernetes-map-type: atomic

config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudclustertemplates.yaml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: ionoscloudclustertemplates.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -53,8 +53,6 @@ spec:
5353
description: |-
5454
ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
5555
56-
57-
TODO(gfariasalves): as of now, IP must be provided by the user as we still don't insert the
5856
provider-provided block IP into the kube-vip manifest.
5957
properties:
6058
host:
@@ -77,10 +75,13 @@ spec:
7775
the credentials to access the IONOS Cloud API.
7876
properties:
7977
name:
78+
default: ""
8079
description: |-
8180
Name of the referent.
81+
This field is effectively required, but due to backwards compatibility is
82+
allowed to be empty. Instances of this type with an empty value here are
83+
almost certainly wrong.
8284
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
83-
TODO: Add other useful fields. apiVersion, kind, uid?
8485
type: string
8586
type: object
8687
x-kubernetes-map-type: atomic
@@ -93,10 +94,13 @@ spec:
9394
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
9495
properties:
9596
name:
97+
default: ""
9698
description: |-
9799
Name of the referent.
100+
This field is effectively required, but due to backwards compatibility is
101+
allowed to be empty. Instances of this type with an empty value here are
102+
almost certainly wrong.
98103
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
99-
TODO: Add other useful fields. apiVersion, kind, uid?
100104
type: string
101105
type: object
102106
x-kubernetes-map-type: atomic

config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachines.yaml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: ionoscloudmachines.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -104,7 +104,6 @@ spec:
104104
CPUFamily defines the CPU architecture, which will be used for this VM.
105105
Not all CPU architectures are available in all data centers.
106106
107-
108107
If not specified, the cloud will select a suitable CPU family
109108
based on the availability in the data center.
110109
example: AMD_OPTERON
@@ -186,7 +185,6 @@ spec:
186185
It can be either set to an already reserved IPv4 address, or it can be set to "AUTO"
187186
which will automatically reserve an IPv4 address for the Failover Group.
188187
189-
190188
If the machine is a control plane machine, this field will not be taken into account.
191189
type: string
192190
x-kubernetes-validations:
@@ -311,7 +309,6 @@ spec:
311309
reconciling the Machine and will contain a more verbose string suitable
312310
for logging and human consumption.
313311
314-
315312
This field should not be set for transitive errors that a controller
316313
faces that are expected to be fixed automatically over
317314
time (like service outages), but instead indicate that something is
@@ -321,7 +318,6 @@ spec:
321318
spec, values that are unsupported by the controller, or the
322319
responsible controller itself being critically misconfigured.
323320
324-
325321
Any transient errors that occur during the reconciliation of IonosCloudMachines
326322
can be added as events to the IonosCloudMachine object and/or logged in the
327323
controller's output.
@@ -332,7 +328,6 @@ spec:
332328
reconciling the Machine and will contain a succinct value suitable
333329
for machine interpretation.
334330
335-
336331
This field should not be set for transitive errors that a controller
337332
faces that are expected to be fixed automatically over
338333
time (like service outages), but instead indicate that something is
@@ -342,7 +337,6 @@ spec:
342337
spec, values that are unsupported by the controller, or the
343338
responsible controller itself being critically misconfigured.
344339
345-
346340
Any transient errors that occur during the reconciliation of IonosCloudMachines
347341
can be added as events to the IonosCloudMachine object and/or logged in the
348342
controller's output.

config/crd/bases/infrastructure.cluster.x-k8s.io_ionoscloudmachinetemplates.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.14.0
6+
controller-gen.kubebuilder.io/version: v0.16.1
77
name: ionoscloudmachinetemplates.infrastructure.cluster.x-k8s.io
88
spec:
99
group: infrastructure.cluster.x-k8s.io
@@ -114,7 +114,6 @@ spec:
114114
CPUFamily defines the CPU architecture, which will be used for this VM.
115115
Not all CPU architectures are available in all data centers.
116116
117-
118117
If not specified, the cloud will select a suitable CPU family
119118
based on the availability in the data center.
120119
example: AMD_OPTERON
@@ -198,7 +197,6 @@ spec:
198197
It can be either set to an already reserved IPv4 address, or it can be set to "AUTO"
199198
which will automatically reserve an IPv4 address for the Failover Group.
200199
201-
202200
If the machine is a control plane machine, this field will not be taken into account.
203201
type: string
204202
x-kubernetes-validations:

config/rbac/role.yaml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,6 @@ rules:
4141
resources:
4242
- clusters
4343
- clusters/status
44-
verbs:
45-
- get
46-
- list
47-
- watch
48-
- apiGroups:
49-
- cluster.x-k8s.io
50-
resources:
5144
- machines
5245
- machines/status
5346
verbs:
@@ -58,31 +51,6 @@ rules:
5851
- infrastructure.cluster.x-k8s.io
5952
resources:
6053
- ionoscloudclusters
61-
verbs:
62-
- create
63-
- delete
64-
- get
65-
- list
66-
- patch
67-
- update
68-
- watch
69-
- apiGroups:
70-
- infrastructure.cluster.x-k8s.io
71-
resources:
72-
- ionoscloudclusters/finalizers
73-
verbs:
74-
- update
75-
- apiGroups:
76-
- infrastructure.cluster.x-k8s.io
77-
resources:
78-
- ionoscloudclusters/status
79-
verbs:
80-
- get
81-
- patch
82-
- update
83-
- apiGroups:
84-
- infrastructure.cluster.x-k8s.io
85-
resources:
8654
- ionoscloudmachines
8755
verbs:
8856
- create
@@ -95,12 +63,14 @@ rules:
9563
- apiGroups:
9664
- infrastructure.cluster.x-k8s.io
9765
resources:
66+
- ionoscloudclusters/finalizers
9867
- ionoscloudmachines/finalizers
9968
verbs:
10069
- update
10170
- apiGroups:
10271
- infrastructure.cluster.x-k8s.io
10372
resources:
73+
- ionoscloudclusters/status
10474
- ionoscloudmachines/status
10575
verbs:
10676
- get

0 commit comments

Comments
 (0)