Skip to content

Commit

Permalink
✨ update CAPI to 1.8.1 (#212)
Browse files Browse the repository at this point in the history
**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)
  • Loading branch information
lubedacht authored Aug 27, 2024
1 parent 0c67905 commit 33a3f06
Show file tree
Hide file tree
Showing 22 changed files with 309 additions and 240 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ envfile

# editor and IDE paraphernalia
.idea
.run
.vscode
*.swp
*.swo
Expand Down
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ linters-settings:
allow:
- error
- generic
- "github.com/ionos-cloud/cluster-api-provider-ionoscloud/internal/ionoscloud.Client"
- ionoscloud.Client
- bootstrap.ClusterProvider
- framework.ClusterProxy
loggercheck:
require-string-key: true
no-printf-like: true
Expand Down Expand Up @@ -199,6 +201,8 @@ issues:
- mock*

run:
build-tags:
- e2e
timeout: 10m
allow-parallel-runners: true
go: "1.22"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest

## Tool Versions
KUSTOMIZE_VERSION ?= v5.1.1
CONTROLLER_TOOLS_VERSION ?= v0.14.0
CONTROLLER_TOOLS_VERSION ?= v0.16.1

.PHONY: kustomize
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary. If wrong version is installed, it will be removed before downloading.
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ If you need help with CAPIC, please visit the [#cluster-api-ionoscloud][slack] c

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

| | Cluster API v1beta1 (v1.7) |
|------------------------|:--------------------------:|
| CAPIC v1alpha1 (v0.2) ||
| CAPIC v1alpha1 (v0.3) ||
| CAPIC v1alpha1 (v0.4) ||
| | Cluster API v1beta1 (v1.7) | Cluster API v1beta1 (v1.8) |
|------------------------|:--------------------------:|:--------------------------:|
| CAPIC v1alpha1 (v0.2) |||
| CAPIC v1alpha1 (v0.3) |||
| CAPIC v1alpha1 (v0.4) |||

### Kubernetes Versions

Expand Down
12 changes: 9 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var (
setupLog = ctrl.Log.WithName("setup")
healthProbeAddr string
enableLeaderElection bool
diagnosticOptions = flags.DiagnosticsOptions{}
managerOptions = flags.ManagerOptions{}

icClusterConcurrency int
icMachineConcurrency int
Expand All @@ -65,9 +65,15 @@ func main() {
initFlags()
pflag.Parse()

_, metricsOptions, err := flags.GetManagerOptions(managerOptions)
if err != nil {
setupLog.Error(err, "unable to get manager options")
os.Exit(1)
}

mgr, err := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
Scheme: scheme,
Metrics: flags.GetDiagnosticsOptions(diagnosticOptions),
Metrics: *metricsOptions,
HealthProbeBindAddress: healthProbeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "15f3d3ca.cluster.x-k8s.io",
Expand Down Expand Up @@ -127,7 +133,7 @@ func main() {
func initFlags() {
klog.InitFlags(nil)
pflag.CommandLine.AddGoFlagSet(flag.CommandLine)
flags.AddDiagnosticsOptions(pflag.CommandLine, &diagnosticOptions)
flags.AddManagerOptions(pflag.CommandLine, &managerOptions)
pflag.StringVar(&healthProbeAddr, "health-probe-bind-address", ":8081",
"The address the probe endpoint binds to.")
pflag.BoolVar(&enableLeaderElection, "leader-elect", false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.1
name: ionoscloudclusters.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -61,8 +61,6 @@ spec:
description: |-
ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
TODO(gfariasalves): as of now, IP must be provided by the user as we still don't insert the
provider-provided block IP into the kube-vip manifest.
properties:
host:
Expand All @@ -85,10 +83,13 @@ spec:
the credentials to access the IONOS Cloud API.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
Expand All @@ -101,10 +102,13 @@ spec:
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.1
name: ionoscloudclustertemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -53,8 +53,6 @@ spec:
description: |-
ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
TODO(gfariasalves): as of now, IP must be provided by the user as we still don't insert the
provider-provided block IP into the kube-vip manifest.
properties:
host:
Expand All @@ -77,10 +75,13 @@ spec:
the credentials to access the IONOS Cloud API.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
Expand All @@ -93,10 +94,13 @@ spec:
An empty loadBalancerProviderRef field is allowed and means to disable any load balancer logic.
properties:
name:
default: ""
description: |-
Name of the referent.
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
TODO: Add other useful fields. apiVersion, kind, uid?
type: string
type: object
x-kubernetes-map-type: atomic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.1
name: ionoscloudmachines.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -104,7 +104,6 @@ spec:
CPUFamily defines the CPU architecture, which will be used for this VM.
Not all CPU architectures are available in all data centers.
If not specified, the cloud will select a suitable CPU family
based on the availability in the data center.
example: AMD_OPTERON
Expand Down Expand Up @@ -186,7 +185,6 @@ spec:
It can be either set to an already reserved IPv4 address, or it can be set to "AUTO"
which will automatically reserve an IPv4 address for the Failover Group.
If the machine is a control plane machine, this field will not be taken into account.
type: string
x-kubernetes-validations:
Expand Down Expand Up @@ -311,7 +309,6 @@ spec:
reconciling the Machine and will contain a more verbose string suitable
for logging and human consumption.
This field should not be set for transitive errors that a controller
faces that are expected to be fixed automatically over
time (like service outages), but instead indicate that something is
Expand All @@ -321,7 +318,6 @@ spec:
spec, values that are unsupported by the controller, or the
responsible controller itself being critically misconfigured.
Any transient errors that occur during the reconciliation of IonosCloudMachines
can be added as events to the IonosCloudMachine object and/or logged in the
controller's output.
Expand All @@ -332,7 +328,6 @@ spec:
reconciling the Machine and will contain a succinct value suitable
for machine interpretation.
This field should not be set for transitive errors that a controller
faces that are expected to be fixed automatically over
time (like service outages), but instead indicate that something is
Expand All @@ -342,7 +337,6 @@ spec:
spec, values that are unsupported by the controller, or the
responsible controller itself being critically misconfigured.
Any transient errors that occur during the reconciliation of IonosCloudMachines
can be added as events to the IonosCloudMachine object and/or logged in the
controller's output.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.14.0
controller-gen.kubebuilder.io/version: v0.16.1
name: ionoscloudmachinetemplates.infrastructure.cluster.x-k8s.io
spec:
group: infrastructure.cluster.x-k8s.io
Expand Down Expand Up @@ -114,7 +114,6 @@ spec:
CPUFamily defines the CPU architecture, which will be used for this VM.
Not all CPU architectures are available in all data centers.
If not specified, the cloud will select a suitable CPU family
based on the availability in the data center.
example: AMD_OPTERON
Expand Down Expand Up @@ -198,7 +197,6 @@ spec:
It can be either set to an already reserved IPv4 address, or it can be set to "AUTO"
which will automatically reserve an IPv4 address for the Failover Group.
If the machine is a control plane machine, this field will not be taken into account.
type: string
x-kubernetes-validations:
Expand Down
34 changes: 2 additions & 32 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ rules:
resources:
- clusters
- clusters/status
verbs:
- get
- list
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machines
- machines/status
verbs:
Expand All @@ -58,31 +51,6 @@ rules:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudclusters
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudclusters/finalizers
verbs:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudclusters/status
verbs:
- get
- patch
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudmachines
verbs:
- create
Expand All @@ -95,12 +63,14 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudclusters/finalizers
- ionoscloudmachines/finalizers
verbs:
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- ionoscloudclusters/status
- ionoscloudmachines/status
verbs:
- get
Expand Down
Loading

0 comments on commit 33a3f06

Please sign in to comment.