Skip to content

Commit 7fa9420

Browse files
authored
⚠️ Adopt CAPI v1beta2 api's (#2383)
* Adopt CAPI v1beta2 api's * Update templates to use v1beta2 version * Version udpate checklist tasks
1 parent b616beb commit 7fa9420

File tree

81 files changed

+858
-836
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+858
-836
lines changed

.golangci.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,10 @@ linters-settings:
8888
alias: capiv1alpha3
8989
- pkg: sigs.k8s.io/cluster-api/api/v1alpha4
9090
alias: capiv1alpha4
91-
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
91+
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta1
9292
alias: capiv1beta1
93+
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta2
94+
alias: clusterv1
9395
# CAPI-IBMCLOUD
9496
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1
9597
alias: infrav1beta1
@@ -121,7 +123,7 @@ linters-settings:
121123
- whyNoLint
122124
- wrapperFunc
123125
unused:
124-
go: "1.23"
126+
go: "1.24"
125127
issues:
126128
max-same-issues: 0
127129
max-issues-per-linter: 0
@@ -207,7 +209,7 @@ issues:
207209
- "zz_generated.*\\.go$"
208210

209211
run:
210-
go: "1.23"
212+
go: "1.24"
211213
timeout: 20m
212214
build-tags:
213215
- tools

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ RELEASE_NOTES_DIR := CHANGELOG
8484
OUTPUT_TYPE ?= type=registry
8585

8686
# Go
87-
GO_VERSION ?=1.23.9
87+
GO_VERSION ?=1.24.3
8888
GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION)
8989

9090
# Trivy
@@ -105,7 +105,7 @@ PULL_POLICY ?= Always
105105
# Set build time variables including version details
106106
LDFLAGS := $(shell ./hack/version.sh)
107107

108-
KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.32.0
108+
KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.33.0
109109

110110
# main controller
111111
CORE_IMAGE_NAME ?= cluster-api-ibmcloud-controller

api/v1beta1/conditions_consts.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
20+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2121
)
2222

2323
const (
@@ -42,7 +42,7 @@ const (
4242

4343
const (
4444
// InstanceReadyCondition reports on current status of the instance. Ready indicates the instance is in a Running state.
45-
InstanceReadyCondition capiv1beta1.ConditionType = "InstanceReady"
45+
InstanceReadyCondition clusterv1.ConditionType = "InstanceReady"
4646
)
4747

4848
const (
@@ -60,10 +60,10 @@ const (
6060

6161
const (
6262
// ImageReadyCondition reports on current status of the image. Ready indicates the image is in a active state.
63-
ImageReadyCondition capiv1beta1.ConditionType = "ImageReady"
63+
ImageReadyCondition clusterv1.ConditionType = "ImageReady"
6464

6565
// ImageImportedCondition reports on current status of the image import job. Ready indicates the import job is finished.
66-
ImageImportedCondition capiv1beta1.ConditionType = "ImageImported"
66+
ImageImportedCondition clusterv1.ConditionType = "ImageImported"
6767
)
6868

6969
const (
@@ -73,5 +73,5 @@ const (
7373

7474
const (
7575
// LoadBalancerReadyCondition reports on current status of the load balancer. Ready indicates the load balancer is in a active state.
76-
LoadBalancerReadyCondition capiv1beta1.ConditionType = "LoadBalancerReady"
76+
LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady"
7777
)

api/v1beta1/ibmpowervscluster_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
)
2424

2525
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -44,7 +44,7 @@ type IBMPowerVSClusterSpec struct {
4444

4545
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
4646
// +optional
47-
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
47+
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
4848
}
4949

5050
// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.

api/v1beta1/ibmpowervsclustertemplate_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
)
2424

2525
// IBMPowerVSClusterTemplateSpec defines the desired state of IBMPowerVSClusterTemplate.
@@ -53,8 +53,8 @@ type IBMPowerVSClusterTemplateResource struct {
5353
// Standard object's metadata.
5454
// More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
5555
// +optional
56-
ObjectMeta capiv1beta1.ObjectMeta `json:"metadata,omitempty"`
57-
Spec IBMPowerVSClusterSpec `json:"spec"`
56+
ObjectMeta clusterv1.ObjectMeta `json:"metadata,omitempty"`
57+
Spec IBMPowerVSClusterSpec `json:"spec"`
5858
}
5959

6060
func init() {

api/v1beta1/ibmpowervsimage_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
)
2424

2525
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -82,7 +82,7 @@ type IBMPowerVSImageStatus struct {
8282

8383
// Conditions defines current service state of the IBMPowerVSImage.
8484
// +optional
85-
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
85+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
8686
}
8787

8888
//+kubebuilder:object:root=true
@@ -100,12 +100,12 @@ type IBMPowerVSImage struct {
100100
}
101101

102102
// GetConditions returns the observations of the operational state of the IBMPowerVSImage resource.
103-
func (r *IBMPowerVSImage) GetConditions() capiv1beta1.Conditions {
103+
func (r *IBMPowerVSImage) GetConditions() clusterv1.Conditions {
104104
return r.Status.Conditions
105105
}
106106

107107
// SetConditions sets the underlying service state of the IBMPowerVSImage to the predescribed clusterv1.Conditions.
108-
func (r *IBMPowerVSImage) SetConditions(conditions capiv1beta1.Conditions) {
108+
func (r *IBMPowerVSImage) SetConditions(conditions clusterv1.Conditions) {
109109
r.Status.Conditions = conditions
110110
}
111111

api/v1beta1/ibmpowervsmachine_types.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
corev1 "k8s.io/api/core/v1"
2121
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2222

23-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
23+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2424
)
2525

2626
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -164,7 +164,7 @@ type IBMPowerVSMachineStatus struct {
164164

165165
// Conditions defines current service state of the IBMPowerVSMachine.
166166
// +optional
167-
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
167+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
168168

169169
// Region specifies the Power VS Service instance region.
170170
Region *string `json:"region,omitempty"`
@@ -194,12 +194,12 @@ type IBMPowerVSMachine struct {
194194
}
195195

196196
// GetConditions returns the observations of the operational state of the IBMPowerVSMachine resource.
197-
func (r *IBMPowerVSMachine) GetConditions() capiv1beta1.Conditions {
197+
func (r *IBMPowerVSMachine) GetConditions() clusterv1.Conditions {
198198
return r.Status.Conditions
199199
}
200200

201201
// SetConditions sets the underlying service state of the IBMPowerVSMachine to the predescribed clusterv1.Conditions.
202-
func (r *IBMPowerVSMachine) SetConditions(conditions capiv1beta1.Conditions) {
202+
func (r *IBMPowerVSMachine) SetConditions(conditions clusterv1.Conditions) {
203203
r.Status.Conditions = conditions
204204
}
205205

api/v1beta1/ibmvpccluster_types.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package v1beta1
1919
import (
2020
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2121

22-
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
22+
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
2323
)
2424

2525
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
@@ -49,7 +49,7 @@ type IBMVPCClusterSpec struct {
4949

5050
// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
5151
// +optional
52-
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
52+
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
5353

5454
// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
5555
// +optional
@@ -83,7 +83,7 @@ type IBMVPCClusterStatus struct {
8383

8484
// Conditions defines current service state of the load balancer.
8585
// +optional
86-
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
86+
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
8787
}
8888

8989
// VPC holds the VPC information.
@@ -121,11 +121,11 @@ func init() {
121121
}
122122

123123
// GetConditions returns the observations of the operational state of the IBMVPCCluster resource.
124-
func (r *IBMVPCCluster) GetConditions() capiv1beta1.Conditions {
124+
func (r *IBMVPCCluster) GetConditions() clusterv1.Conditions {
125125
return r.Status.Conditions
126126
}
127127

128128
// SetConditions sets the underlying service state of the IBMVPCCluster to the predescribed clusterv1.Conditions.
129-
func (r *IBMVPCCluster) SetConditions(conditions capiv1beta1.Conditions) {
129+
func (r *IBMVPCCluster) SetConditions(conditions clusterv1.Conditions) {
130130
r.Status.Conditions = conditions
131131
}

api/v1beta1/zz_generated.conversion.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)