Skip to content

⚠️ Adjust import alias to align with CAPI migration recommendation #2393

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 2 commits into from
Jun 19, 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
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ linters-settings:
- pkg: sigs.k8s.io/cluster-api/api/v1alpha4
alias: capiv1alpha4
- pkg: sigs.k8s.io/cluster-api/api/core/v1beta1
alias: capiv1beta1
alias: clusterv1beta1
- 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
- pkg: sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2
alias: infrav1beta2
alias: infrav1
nolintlint:
allow-unused: false
allow-leading-space: false
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 (
clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck
)

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 clusterv1.ConditionType = "InstanceReady"
InstanceReadyCondition clusterv1beta1.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 clusterv1.ConditionType = "ImageReady"
ImageReadyCondition clusterv1beta1.ConditionType = "ImageReady"

// ImageImportedCondition reports on current status of the image import job. Ready indicates the import job is finished.
ImageImportedCondition clusterv1.ConditionType = "ImageImported"
ImageImportedCondition clusterv1beta1.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 clusterv1.ConditionType = "LoadBalancerReady"
LoadBalancerReadyCondition clusterv1beta1.ConditionType = "LoadBalancerReady"
)
78 changes: 39 additions & 39 deletions api/v1beta1/ibmpowervs_conversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,130 +26,130 @@ import (

"sigs.k8s.io/controller-runtime/pkg/conversion"

infrav1beta2 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2"
infrav1 "sigs.k8s.io/cluster-api-provider-ibmcloud/api/v1beta2"
)

func (src *IBMPowerVSCluster) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSCluster)
dst := dstRaw.(*infrav1.IBMPowerVSCluster)

return Convert_v1beta1_IBMPowerVSCluster_To_v1beta2_IBMPowerVSCluster(src, dst, nil)
}

func (dst *IBMPowerVSCluster) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSCluster)
src := srcRaw.(*infrav1.IBMPowerVSCluster)

return Convert_v1beta2_IBMPowerVSCluster_To_v1beta1_IBMPowerVSCluster(src, dst, nil)
}

func (src *IBMPowerVSClusterList) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSClusterList)
dst := dstRaw.(*infrav1.IBMPowerVSClusterList)

return Convert_v1beta1_IBMPowerVSClusterList_To_v1beta2_IBMPowerVSClusterList(src, dst, nil)
}

func (dst *IBMPowerVSClusterList) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSClusterList)
src := srcRaw.(*infrav1.IBMPowerVSClusterList)

return Convert_v1beta2_IBMPowerVSClusterList_To_v1beta1_IBMPowerVSClusterList(src, dst, nil)
}

func (src *IBMPowerVSClusterTemplate) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSClusterTemplate)
dst := dstRaw.(*infrav1.IBMPowerVSClusterTemplate)

return Convert_v1beta1_IBMPowerVSClusterTemplate_To_v1beta2_IBMPowerVSClusterTemplate(src, dst, nil)
}

func (dst *IBMPowerVSClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSClusterTemplate)
src := srcRaw.(*infrav1.IBMPowerVSClusterTemplate)

return Convert_v1beta2_IBMPowerVSClusterTemplate_To_v1beta1_IBMPowerVSClusterTemplate(src, dst, nil)
}

func (src *IBMPowerVSClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSClusterTemplateList)
dst := dstRaw.(*infrav1.IBMPowerVSClusterTemplateList)

return Convert_v1beta1_IBMPowerVSClusterTemplateList_To_v1beta2_IBMPowerVSClusterTemplateList(src, dst, nil)
}

func (dst *IBMPowerVSClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSClusterTemplateList)
src := srcRaw.(*infrav1.IBMPowerVSClusterTemplateList)

return Convert_v1beta2_IBMPowerVSClusterTemplateList_To_v1beta1_IBMPowerVSClusterTemplateList(src, dst, nil)
}

func (src *IBMPowerVSMachine) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSMachine)
dst := dstRaw.(*infrav1.IBMPowerVSMachine)

return Convert_v1beta1_IBMPowerVSMachine_To_v1beta2_IBMPowerVSMachine(src, dst, nil)
}

func (dst *IBMPowerVSMachine) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSMachine)
src := srcRaw.(*infrav1.IBMPowerVSMachine)

return Convert_v1beta2_IBMPowerVSMachine_To_v1beta1_IBMPowerVSMachine(src, dst, nil)
}

func (src *IBMPowerVSMachineList) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSMachineList)
dst := dstRaw.(*infrav1.IBMPowerVSMachineList)

return Convert_v1beta1_IBMPowerVSMachineList_To_v1beta2_IBMPowerVSMachineList(src, dst, nil)
}

func (dst *IBMPowerVSMachineList) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSMachineList)
src := srcRaw.(*infrav1.IBMPowerVSMachineList)

return Convert_v1beta2_IBMPowerVSMachineList_To_v1beta1_IBMPowerVSMachineList(src, dst, nil)
}

func (src *IBMPowerVSMachineTemplate) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSMachineTemplate)
dst := dstRaw.(*infrav1.IBMPowerVSMachineTemplate)

return Convert_v1beta1_IBMPowerVSMachineTemplate_To_v1beta2_IBMPowerVSMachineTemplate(src, dst, nil)
}

func (dst *IBMPowerVSMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSMachineTemplate)
src := srcRaw.(*infrav1.IBMPowerVSMachineTemplate)

return Convert_v1beta2_IBMPowerVSMachineTemplate_To_v1beta1_IBMPowerVSMachineTemplate(src, dst, nil)
}

func (src *IBMPowerVSMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSMachineTemplateList)
dst := dstRaw.(*infrav1.IBMPowerVSMachineTemplateList)

return Convert_v1beta1_IBMPowerVSMachineTemplateList_To_v1beta2_IBMPowerVSMachineTemplateList(src, dst, nil)
}

func (dst *IBMPowerVSMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSMachineTemplateList)
src := srcRaw.(*infrav1.IBMPowerVSMachineTemplateList)

return Convert_v1beta2_IBMPowerVSMachineTemplateList_To_v1beta1_IBMPowerVSMachineTemplateList(src, dst, nil)
}

func (src *IBMPowerVSImage) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSImage)
dst := dstRaw.(*infrav1.IBMPowerVSImage)

return Convert_v1beta1_IBMPowerVSImage_To_v1beta2_IBMPowerVSImage(src, dst, nil)
}

func (dst *IBMPowerVSImage) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSImage)
src := srcRaw.(*infrav1.IBMPowerVSImage)

return Convert_v1beta2_IBMPowerVSImage_To_v1beta1_IBMPowerVSImage(src, dst, nil)
}

func (src *IBMPowerVSImageList) ConvertTo(dstRaw conversion.Hub) error {
dst := dstRaw.(*infrav1beta2.IBMPowerVSImageList)
dst := dstRaw.(*infrav1.IBMPowerVSImageList)

return Convert_v1beta1_IBMPowerVSImageList_To_v1beta2_IBMPowerVSImageList(src, dst, nil)
}

func (dst *IBMPowerVSImageList) ConvertFrom(srcRaw conversion.Hub) error {
src := srcRaw.(*infrav1beta2.IBMPowerVSImageList)
src := srcRaw.(*infrav1.IBMPowerVSImageList)

return Convert_v1beta2_IBMPowerVSImageList_To_v1beta1_IBMPowerVSImageList(src, dst, nil)
}

func Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in *IBMPowerVSMachineSpec, out *infrav1beta2.IBMPowerVSMachineSpec, s apiconversion.Scope) error {
func Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in *IBMPowerVSMachineSpec, out *infrav1.IBMPowerVSMachineSpec, s apiconversion.Scope) error {
out.SystemType = in.SysType
out.Processors = intstr.FromString(in.Processors)

Expand All @@ -160,18 +160,18 @@ func Convert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in *
out.MemoryGiB = int32(memory)

switch in.ProcType {
case strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeDedicated)):
out.ProcessorType = infrav1beta2.PowerVSProcessorTypeDedicated
case strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeShared)):
out.ProcessorType = infrav1beta2.PowerVSProcessorTypeShared
case strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeCapped)):
out.ProcessorType = infrav1beta2.PowerVSProcessorTypeCapped
case strings.ToLower(string(infrav1.PowerVSProcessorTypeDedicated)):
out.ProcessorType = infrav1.PowerVSProcessorTypeDedicated
case strings.ToLower(string(infrav1.PowerVSProcessorTypeShared)):
out.ProcessorType = infrav1.PowerVSProcessorTypeShared
case strings.ToLower(string(infrav1.PowerVSProcessorTypeCapped)):
out.ProcessorType = infrav1.PowerVSProcessorTypeCapped
}

return autoConvert_v1beta1_IBMPowerVSMachineSpec_To_v1beta2_IBMPowerVSMachineSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *infrav1beta2.IBMPowerVSMachineSpec, out *IBMPowerVSMachineSpec, s apiconversion.Scope) error {
func Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *infrav1.IBMPowerVSMachineSpec, out *IBMPowerVSMachineSpec, s apiconversion.Scope) error {
out.SysType = in.SystemType
out.Memory = strconv.FormatInt(int64(in.MemoryGiB), 10)

Expand All @@ -183,33 +183,33 @@ func Convert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in *
}

switch in.ProcessorType {
case infrav1beta2.PowerVSProcessorTypeDedicated:
out.ProcType = strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeDedicated))
case infrav1beta2.PowerVSProcessorTypeShared:
out.ProcType = strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeShared))
case infrav1beta2.PowerVSProcessorTypeCapped:
out.ProcType = strings.ToLower(string(infrav1beta2.PowerVSProcessorTypeCapped))
case infrav1.PowerVSProcessorTypeDedicated:
out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeDedicated))
case infrav1.PowerVSProcessorTypeShared:
out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeShared))
case infrav1.PowerVSProcessorTypeCapped:
out.ProcType = strings.ToLower(string(infrav1.PowerVSProcessorTypeCapped))
}

return autoConvert_v1beta2_IBMPowerVSMachineSpec_To_v1beta1_IBMPowerVSMachineSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in *infrav1beta2.IBMPowerVSClusterSpec, out *IBMPowerVSClusterSpec, s apiconversion.Scope) error {
func Convert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in *infrav1.IBMPowerVSClusterSpec, out *IBMPowerVSClusterSpec, s apiconversion.Scope) error {
if in.ServiceInstance != nil && in.ServiceInstance.ID != nil {
out.ServiceInstanceID = *in.ServiceInstance.ID
}
return autoConvert_v1beta2_IBMPowerVSClusterSpec_To_v1beta1_IBMPowerVSClusterSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *infrav1beta2.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s apiconversion.Scope) error {
func Convert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in *infrav1.IBMPowerVSClusterStatus, out *IBMPowerVSClusterStatus, s apiconversion.Scope) error {
return autoConvert_v1beta2_IBMPowerVSClusterStatus_To_v1beta1_IBMPowerVSClusterStatus(in, out, s)
}

func Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in *infrav1beta2.IBMPowerVSImageSpec, out *IBMPowerVSImageSpec, s apiconversion.Scope) error {
func Convert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in *infrav1.IBMPowerVSImageSpec, out *IBMPowerVSImageSpec, s apiconversion.Scope) error {
return autoConvert_v1beta2_IBMPowerVSImageSpec_To_v1beta1_IBMPowerVSImageSpec(in, out, s)
}

func Convert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in *infrav1beta2.IBMPowerVSMachineStatus, out *IBMPowerVSMachineStatus, s apiconversion.Scope) error {
func Convert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in *infrav1.IBMPowerVSMachineStatus, out *IBMPowerVSMachineStatus, s apiconversion.Scope) error {
// CAPI V1Beta2 was added in CAPIBM v1beta2
return autoConvert_v1beta2_IBMPowerVSMachineStatus_To_v1beta1_IBMPowerVSMachineStatus(in, out, s)
}
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"

clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck
)

// 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 clusterv1.APIEndpoint `json:"controlPlaneEndpoint"`
ControlPlaneEndpoint clusterv1beta1.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"

clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck
)

// 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 clusterv1.ObjectMeta `json:"metadata,omitempty"`
Spec IBMPowerVSClusterSpec `json:"spec"`
ObjectMeta clusterv1beta1.ObjectMeta `json:"metadata,omitempty"`
Spec IBMPowerVSClusterSpec `json:"spec"`
}

func init() {
Expand Down
10 changes: 5 additions & 5 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"

clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck
)

// 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 clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1beta1.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() clusterv1.Conditions {
func (r *IBMPowerVSImage) GetConditions() clusterv1beta1.Conditions {
return r.Status.Conditions
}

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

Expand Down
10 changes: 5 additions & 5 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"

clusterv1 "sigs.k8s.io/cluster-api/api/core/v1beta2"
clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck
)

// 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 clusterv1.Conditions `json:"conditions,omitempty"`
Conditions clusterv1beta1.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() clusterv1.Conditions {
func (r *IBMPowerVSMachine) GetConditions() clusterv1beta1.Conditions {
return r.Status.Conditions
}

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

Expand Down
Loading