Skip to content

⚠️ Adopt CAPI v1beta2 api's #2383

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,10 @@ linters-settings:
alias: capiv1alpha3
- pkg: sigs.k8s.io/cluster-api/api/v1alpha4
alias: capiv1alpha4
- pkg: sigs.k8s.io/cluster-api/api/v1beta1
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta1
alias: capiv1beta1
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta2
alias: clusterv1
# CAPI-IBMCLOUD
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta1
alias: infrav1beta1
Expand Down Expand Up @@ -121,7 +123,7 @@ linters-settings:
- whyNoLint
- wrapperFunc
unused:
go: "1.23"
go: "1.24"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down Expand Up @@ -207,7 +209,7 @@ issues:
- "zz_generated.*\\.go$"

run:
go: "1.23"
go: "1.24"
timeout: 20m
build-tags:
- tools
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ RELEASE_NOTES_DIR := CHANGELOG
OUTPUT_TYPE ?= type=registry

# Go
GO_VERSION ?=1.23.9
GO_VERSION ?=1.24.3
GO_CONTAINER_IMAGE ?= golang:$(GO_VERSION)

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

KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.32.0
KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.33.0

# main controller
CORE_IMAGE_NAME ?= cluster-api-ibmcloud-controller
Expand Down
10 changes: 5 additions & 5 deletions api/v1beta1/conditions_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ limitations under the License.
package v1beta1

import (
capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

const (
Expand All @@ -42,7 +42,7 @@ const (

const (
// InstanceReadyCondition reports on current status of the instance. Ready indicates the instance is in a Running state.
InstanceReadyCondition capiv1beta1.ConditionType = "InstanceReady"
InstanceReadyCondition clusterv1.ConditionType = "InstanceReady"
)

const (
Expand All @@ -60,10 +60,10 @@ const (

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

// ImageImportedCondition reports on current status of the image import job. Ready indicates the import job is finished.
ImageImportedCondition capiv1beta1.ConditionType = "ImageImported"
ImageImportedCondition clusterv1.ConditionType = "ImageImported"
)

const (
Expand All @@ -73,5 +73,5 @@ const (

const (
// LoadBalancerReadyCondition reports on current status of the load balancer. Ready indicates the load balancer is in a active state.
LoadBalancerReadyCondition capiv1beta1.ConditionType = "LoadBalancerReady"
LoadBalancerReadyCondition clusterv1.ConditionType = "LoadBalancerReady"
)
4 changes: 2 additions & 2 deletions api/v1beta1/ibmpowervscluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

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

// ControlPlaneEndpoint represents the endpoint used to communicate with the control plane.
// +optional
ControlPlaneEndpoint capiv1beta1.APIEndpoint `json:"controlPlaneEndpoint"`
ControlPlaneEndpoint clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
}

// IBMPowerVSClusterStatus defines the observed state of IBMPowerVSCluster.
Expand Down
6 changes: 3 additions & 3 deletions api/v1beta1/ibmpowervsclustertemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

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

func init() {
Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/ibmpowervsimage_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

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

// Conditions defines current service state of the IBMPowerVSImage.
// +optional
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

//+kubebuilder:object:root=true
Expand All @@ -100,12 +100,12 @@ type IBMPowerVSImage struct {
}

// GetConditions returns the observations of the operational state of the IBMPowerVSImage resource.
func (r *IBMPowerVSImage) GetConditions() capiv1beta1.Conditions {
func (r *IBMPowerVSImage) GetConditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the IBMPowerVSImage to the predescribed clusterv1.Conditions.
func (r *IBMPowerVSImage) SetConditions(conditions capiv1beta1.Conditions) {
func (r *IBMPowerVSImage) SetConditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}

Expand Down
8 changes: 4 additions & 4 deletions api/v1beta1/ibmpowervsmachine_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

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

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

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

// GetConditions returns the observations of the operational state of the IBMPowerVSMachine resource.
func (r *IBMPowerVSMachine) GetConditions() capiv1beta1.Conditions {
func (r *IBMPowerVSMachine) GetConditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the IBMPowerVSMachine to the predescribed clusterv1.Conditions.
func (r *IBMPowerVSMachine) SetConditions(conditions capiv1beta1.Conditions) {
func (r *IBMPowerVSMachine) SetConditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}

Expand Down
10 changes: 5 additions & 5 deletions api/v1beta1/ibmvpccluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package v1beta1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

capiv1beta1 "sigs.k8s.io/cluster-api/api/v1beta1"
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
)

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

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

// ControlPlaneLoadBalancer is optional configuration for customizing control plane behavior.
// +optional
Expand Down Expand Up @@ -83,7 +83,7 @@ type IBMVPCClusterStatus struct {

// Conditions defines current service state of the load balancer.
// +optional
Conditions capiv1beta1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1.Conditions `json:"conditions,omitempty"`
}

// VPC holds the VPC information.
Expand Down Expand Up @@ -121,11 +121,11 @@ func init() {
}

// GetConditions returns the observations of the operational state of the IBMVPCCluster resource.
func (r *IBMVPCCluster) GetConditions() capiv1beta1.Conditions {
func (r *IBMVPCCluster) GetConditions() clusterv1.Conditions {
return r.Status.Conditions
}

// SetConditions sets the underlying service state of the IBMVPCCluster to the predescribed clusterv1.Conditions.
func (r *IBMVPCCluster) SetConditions(conditions capiv1beta1.Conditions) {
func (r *IBMVPCCluster) SetConditions(conditions clusterv1.Conditions) {
r.Status.Conditions = conditions
}
14 changes: 7 additions & 7 deletions api/v1beta1/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading