From d38b9186b0b19e10c44044a583b9b2380786b5de Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Mon, 7 Aug 2023 14:20:38 +0200 Subject: [PATCH] lint: fix import aliases --- .golangci.yml | 100 +++++++++--------- apis/v1alpha3/vspherecluster_conversion.go | 14 +-- .../vsphereclusteridentity_conversion.go | 10 +- .../vspheredeploymentzone_conversion.go | 10 +- .../vspherefailuredomain_conversion.go | 10 +- apis/v1alpha3/vspheremachine_conversion.go | 12 +-- .../vspheremachinetemplate_conversion.go | 12 +-- apis/v1alpha3/vspherevm_conversion.go | 12 +-- apis/v1alpha4/conversion.go | 14 +-- apis/v1alpha4/networkdevicespec_conversion.go | 4 +- apis/v1alpha4/types.go | 4 +- apis/v1alpha4/vspherecluster_conversion.go | 10 +- apis/v1alpha4/vspherecluster_types.go | 10 +- .../vsphereclusteridentity_conversion.go | 10 +- apis/v1alpha4/vsphereclusteridentity_types.go | 8 +- .../vsphereclustertemplate_conversion.go | 10 +- .../vspheredeploymentzone_conversion.go | 10 +- apis/v1alpha4/vspheredeploymentzone_types.go | 8 +- .../vspherefailuredomain_conversion.go | 10 +- apis/v1alpha4/vspheremachine_conversion.go | 12 +-- apis/v1alpha4/vspheremachine_types.go | 10 +- .../vspheremachinetemplate_conversion.go | 24 ++--- apis/v1alpha4/vspherevm_conversion.go | 12 +-- apis/v1alpha4/vspherevm_types.go | 8 +- apis/vmware/v1beta1/vspheremachine_types.go | 6 +- .../svcdiscovery_controller_suite_test.go | 6 +- .../svcdiscovery_controller_unit_test.go | 16 +-- .../vmware/vspherecluster_reconciler_test.go | 10 +- controllers/vspherecluster_reconciler.go | 6 +- ...vspheredeploymentzone_controller_domain.go | 4 +- controllers/vspherevm_controller.go | 4 +- main.go | 28 ++--- packaging/flavorgen/flavors/crs/util.go | 24 ++--- pkg/constants/constants.go | 6 +- .../fake/fake_guest_cluster_context.go | 4 +- .../fake/fake_vmware_cluster_context.go | 4 +- pkg/context/interfaces.go | 4 +- pkg/context/machine_context.go | 4 +- pkg/context/vmware/cluster_context.go | 10 +- pkg/context/vmware/machine_context.go | 4 +- pkg/identity/identity.go | 8 +- pkg/manager/manager.go | 16 +-- pkg/services/govmomi/vcenter/clone_test.go | 8 +- pkg/services/network/dummy_provider.go | 4 +- pkg/services/network/netop_provider.go | 10 +- pkg/services/network/network_test.go | 44 ++++---- pkg/services/network/nsxt_provider.go | 14 +-- .../vmoperator/control_plane_endpoint.go | 14 +-- .../vmoperator/control_plane_endpoint_test.go | 18 ++-- pkg/session/session_test.go | 4 +- pkg/util/cluster.go | 6 +- pkg/util/machines.go | 6 +- pkg/util/networkutil.go | 6 +- pkg/util/testutil.go | 26 ++--- test/e2e/dhcp_overrides_test.go | 4 +- test/e2e/e2e_suite_test.go | 4 +- test/e2e/gpu_pci_passthrough_test.go | 4 +- test/e2e/storage_policy_test.go | 4 +- test/integration/integration_suite_test.go | 46 ++++---- test/integration/sanity_test.go | 4 +- 60 files changed, 367 insertions(+), 367 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 60e3f8c429..65e95fb1b2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -85,56 +85,56 @@ linters-settings: # - wrapperFunc # - rangeValCopy # - hugeParam - # importas: - # no-unaliased: true - # alias: - # # Kubernetes - # - pkg: k8s.io/api/core/v1 - # alias: corev1 - # - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 - # alias: apiextensionsv1 - # - pkg: k8s.io/apimachinery/pkg/apis/meta/v1 - # alias: metav1 - # - pkg: k8s.io/apimachinery/pkg/api/errors - # alias: apierrors - # - pkg: k8s.io/apimachinery/pkg/util/errors - # alias: kerrors - # - pkg: k8s.io/component-base/logs/api/v1 - # alias: logsv1 - # # Controller Runtime - # - pkg: sigs.k8s.io/controller-runtime - # alias: ctrl - # # CAPV - # - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1 - # alias: infrav1 - # - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha3 - # alias: infrav1alpha3 - # - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha4 - # alias: infrav1alpha4 - # - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1 - # alias: vmwarev1 - # # VMware Operator - # - pkg: "github.com/vmware-tanzu/vm-operator/api/v1alpha1" - # alias: vmoprv1 - # # CABPK - # - pkg: sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 - # alias: bootstrapv1 - # # KCP - # - pkg: sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1 - # alias: controlplanev1 - # # CAPI - # - pkg: sigs.k8s.io/cluster-api/api/v1alpha3 - # alias: clusterv1alpha3 - # - pkg: sigs.k8s.io/cluster-api/api/v1alpha4 - # alias: clusterv1alpha4 - # - pkg: sigs.k8s.io/cluster-api/api/v1beta1 - # alias: clusterv1 - # # CAPI exp - # - pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1 - # alias: expv1 - # # CAPI exp addons - # - pkg: sigs.k8s.io/cluster-api/exp/addons/api/v1beta1 - # alias: addonsv1 + importas: + no-unaliased: true + alias: + # Kubernetes + - pkg: k8s.io/api/core/v1 + alias: corev1 + - pkg: k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1 + alias: apiextensionsv1 + - pkg: k8s.io/apimachinery/pkg/apis/meta/v1 + alias: metav1 + - pkg: k8s.io/apimachinery/pkg/api/errors + alias: apierrors + - pkg: k8s.io/apimachinery/pkg/util/errors + alias: kerrors + - pkg: k8s.io/component-base/logs/api/v1 + alias: logsv1 + # Controller Runtime + - pkg: sigs.k8s.io/controller-runtime + alias: ctrl + # CAPV + - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1 + alias: infrav1 + - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha3 + alias: infrav1alpha3 + - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha4 + alias: infrav1alpha4 + - pkg: sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1 + alias: vmwarev1 + # VMware Operator + - pkg: "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + alias: vmoprv1 + # CABPK + - pkg: sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1 + alias: bootstrapv1 + # KCP + - pkg: sigs.k8s.io/cluster-api/controlplane/kubeadm/api/v1beta1 + alias: controlplanev1 + # CAPI + - pkg: sigs.k8s.io/cluster-api/api/v1alpha3 + alias: clusterv1alpha3 + - pkg: sigs.k8s.io/cluster-api/api/v1alpha4 + alias: clusterv1alpha4 + - pkg: sigs.k8s.io/cluster-api/api/v1beta1 + alias: clusterv1 + # CAPI exp + - pkg: sigs.k8s.io/cluster-api/exp/api/v1beta1 + alias: expv1 + # CAPI exp addons + - pkg: sigs.k8s.io/cluster-api/exp/addons/api/v1beta1 + alias: addonsv1 nolintlint: allow-unused: false allow-leading-space: false diff --git a/apis/v1alpha3/vspherecluster_conversion.go b/apis/v1alpha3/vspherecluster_conversion.go index d060141f56..94f3bcbd51 100644 --- a/apis/v1alpha3/vspherecluster_conversion.go +++ b/apis/v1alpha3/vspherecluster_conversion.go @@ -22,18 +22,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereCluster to the Hub version (v1beta1). func (src *VSphereCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereCluster) + dst := dstRaw.(*infrav1.VSphereCluster) if err := Convert_v1alpha3_VSphereCluster_To_v1beta1_VSphereCluster(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereCluster{} + restored := &infrav1.VSphereCluster{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -45,7 +45,7 @@ func (src *VSphereCluster) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereCluster. func (dst *VSphereCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereCluster) + src := srcRaw.(*infrav1.VSphereCluster) if err := Convert_v1beta1_VSphereCluster_To_v1alpha3_VSphereCluster(src, dst, nil); err != nil { return err } @@ -59,16 +59,16 @@ func (dst *VSphereCluster) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VSphereClusterList to the Hub version (v1beta1). func (src *VSphereClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterList) + dst := dstRaw.(*infrav1.VSphereClusterList) return Convert_v1alpha3_VSphereClusterList_To_v1beta1_VSphereClusterList(src, dst, nil) } // ConvertFrom converts this VSphereVM to the Hub version (v1beta1). func (dst *VSphereClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereClusterList) + src := srcRaw.(*infrav1.VSphereClusterList) return Convert_v1beta1_VSphereClusterList_To_v1alpha3_VSphereClusterList(src, dst, nil) } -func Convert_v1alpha3_VSphereClusterSpec_To_v1beta1_VSphereClusterSpec(in *VSphereClusterSpec, out *infrav1beta1.VSphereClusterSpec, s apiconversion.Scope) error { +func Convert_v1alpha3_VSphereClusterSpec_To_v1beta1_VSphereClusterSpec(in *VSphereClusterSpec, out *infrav1.VSphereClusterSpec, s apiconversion.Scope) error { return autoConvert_v1alpha3_VSphereClusterSpec_To_v1beta1_VSphereClusterSpec(in, out, s) } diff --git a/apis/v1alpha3/vsphereclusteridentity_conversion.go b/apis/v1alpha3/vsphereclusteridentity_conversion.go index fc719eb9ba..7a2ab815c2 100644 --- a/apis/v1alpha3/vsphereclusteridentity_conversion.go +++ b/apis/v1alpha3/vsphereclusteridentity_conversion.go @@ -19,12 +19,12 @@ package v1alpha3 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereClusterIdentity to the Hub version (v1beta1). func (src *VSphereClusterIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterIdentity) + dst := dstRaw.(*infrav1.VSphereClusterIdentity) if err := Convert_v1alpha3_VSphereClusterIdentity_To_v1beta1_VSphereClusterIdentity(src, dst, nil); err != nil { return err } @@ -33,7 +33,7 @@ func (src *VSphereClusterIdentity) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterIdentity. func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterIdentity) + src := srcRaw.(*infrav1.VSphereClusterIdentity) if err := Convert_v1beta1_VSphereClusterIdentity_To_v1alpha3_VSphereClusterIdentity(src, dst, nil); err != nil { return err } @@ -42,12 +42,12 @@ func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // // ConvertTo converts this VSphereClusterIdentityList to the Hub version (v1beta1). func (src *VSphereClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterIdentityList) + dst := dstRaw.(*infrav1.VSphereClusterIdentityList) return Convert_v1alpha3_VSphereClusterIdentityList_To_v1beta1_VSphereClusterIdentityList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterIdentityList. func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterIdentityList) + src := srcRaw.(*infrav1.VSphereClusterIdentityList) return Convert_v1beta1_VSphereClusterIdentityList_To_v1alpha3_VSphereClusterIdentityList(src, dst, nil) } diff --git a/apis/v1alpha3/vspheredeploymentzone_conversion.go b/apis/v1alpha3/vspheredeploymentzone_conversion.go index 0cb0ce6134..fe6f1f8fdc 100644 --- a/apis/v1alpha3/vspheredeploymentzone_conversion.go +++ b/apis/v1alpha3/vspheredeploymentzone_conversion.go @@ -19,29 +19,29 @@ package v1alpha3 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereDeploymentZone to the Hub version (v1beta1). func (src *VSphereDeploymentZone) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereDeploymentZone) + dst := dstRaw.(*infrav1.VSphereDeploymentZone) return Convert_v1alpha3_VSphereDeploymentZone_To_v1beta1_VSphereDeploymentZone(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereDeploymentZone. func (dst *VSphereDeploymentZone) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereDeploymentZone) + src := srcRaw.(*infrav1.VSphereDeploymentZone) return Convert_v1beta1_VSphereDeploymentZone_To_v1alpha3_VSphereDeploymentZone(src, dst, nil) } // ConvertTo converts this VSphereDeploymentZoneList to the Hub version (v1beta1). func (src *VSphereDeploymentZoneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereDeploymentZoneList) + dst := dstRaw.(*infrav1.VSphereDeploymentZoneList) return Convert_v1alpha3_VSphereDeploymentZoneList_To_v1beta1_VSphereDeploymentZoneList(src, dst, nil) } // ConvertFrom converts this VSphereDeploymentZoneList to the Hub version (v1beta1). func (dst *VSphereDeploymentZoneList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereDeploymentZoneList) + src := srcRaw.(*infrav1.VSphereDeploymentZoneList) return Convert_v1beta1_VSphereDeploymentZoneList_To_v1alpha3_VSphereDeploymentZoneList(src, dst, nil) } diff --git a/apis/v1alpha3/vspherefailuredomain_conversion.go b/apis/v1alpha3/vspherefailuredomain_conversion.go index 546355af0a..4cd8388959 100644 --- a/apis/v1alpha3/vspherefailuredomain_conversion.go +++ b/apis/v1alpha3/vspherefailuredomain_conversion.go @@ -19,29 +19,29 @@ package v1alpha3 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereFailureDomain to the Hub version (v1beta1). func (src *VSphereFailureDomain) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereFailureDomain) + dst := dstRaw.(*infrav1.VSphereFailureDomain) return Convert_v1alpha3_VSphereFailureDomain_To_v1beta1_VSphereFailureDomain(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereFailureDomain. func (dst *VSphereFailureDomain) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereFailureDomain) + src := srcRaw.(*infrav1.VSphereFailureDomain) return Convert_v1beta1_VSphereFailureDomain_To_v1alpha3_VSphereFailureDomain(src, dst, nil) } // ConvertTo converts this VSphereFailureDomainList to the Hub version (v1beta1). func (src *VSphereFailureDomainList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereFailureDomainList) + dst := dstRaw.(*infrav1.VSphereFailureDomainList) return Convert_v1alpha3_VSphereFailureDomainList_To_v1beta1_VSphereFailureDomainList(src, dst, nil) } // ConvertFrom converts this VSphereFailureDomainList to the Hub version (v1beta1). func (dst *VSphereFailureDomainList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereFailureDomainList) + src := srcRaw.(*infrav1.VSphereFailureDomainList) return Convert_v1beta1_VSphereFailureDomainList_To_v1alpha3_VSphereFailureDomainList(src, dst, nil) } diff --git a/apis/v1alpha3/vspheremachine_conversion.go b/apis/v1alpha3/vspheremachine_conversion.go index bebc6f34dc..345d7fde12 100644 --- a/apis/v1alpha3/vspheremachine_conversion.go +++ b/apis/v1alpha3/vspheremachine_conversion.go @@ -21,18 +21,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereMachine to the Hub version (v1beta1). func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachine) + dst := dstRaw.(*infrav1.VSphereMachine) if err := Convert_v1alpha3_VSphereMachine_To_v1beta1_VSphereMachine(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereMachine{} + restored := &infrav1.VSphereMachine{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -52,7 +52,7 @@ func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereMachine. func (dst *VSphereMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachine) + src := srcRaw.(*infrav1.VSphereMachine) if err := Convert_v1beta1_VSphereMachine_To_v1alpha3_VSphereMachine(src, dst, nil); err != nil { return err } @@ -67,12 +67,12 @@ func (dst *VSphereMachine) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VSphereMachineList to the Hub version (v1beta1). func (src *VSphereMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineList) + dst := dstRaw.(*infrav1.VSphereMachineList) return Convert_v1alpha3_VSphereMachineList_To_v1beta1_VSphereMachineList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereMachineList. func (dst *VSphereMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineList) + src := srcRaw.(*infrav1.VSphereMachineList) return Convert_v1beta1_VSphereMachineList_To_v1alpha3_VSphereMachineList(src, dst, nil) } diff --git a/apis/v1alpha3/vspheremachinetemplate_conversion.go b/apis/v1alpha3/vspheremachinetemplate_conversion.go index 96c000386d..14ced56475 100644 --- a/apis/v1alpha3/vspheremachinetemplate_conversion.go +++ b/apis/v1alpha3/vspheremachinetemplate_conversion.go @@ -24,18 +24,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo. func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineTemplate) + dst := dstRaw.(*infrav1.VSphereMachineTemplate) if err := Convert_v1alpha3_VSphereMachineTemplate_To_v1beta1_VSphereMachineTemplate(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereMachineTemplate{} + restored := &infrav1.VSphereMachineTemplate{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -53,7 +53,7 @@ func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { } func (dst *VSphereMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineTemplate) + src := srcRaw.(*infrav1.VSphereMachineTemplate) if err := Convert_v1beta1_VSphereMachineTemplate_To_v1alpha3_VSphereMachineTemplate(src, dst, nil); err != nil { return err } @@ -67,12 +67,12 @@ func (dst *VSphereMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { } func (src *VSphereMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineTemplateList) + dst := dstRaw.(*infrav1.VSphereMachineTemplateList) return Convert_v1alpha3_VSphereMachineTemplateList_To_v1beta1_VSphereMachineTemplateList(src, dst, nil) } func (dst *VSphereMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineTemplateList) + src := srcRaw.(*infrav1.VSphereMachineTemplateList) return Convert_v1beta1_VSphereMachineTemplateList_To_v1alpha3_VSphereMachineTemplateList(src, dst, nil) } diff --git a/apis/v1alpha3/vspherevm_conversion.go b/apis/v1alpha3/vspherevm_conversion.go index a54729577a..2d62a93213 100644 --- a/apis/v1alpha3/vspherevm_conversion.go +++ b/apis/v1alpha3/vspherevm_conversion.go @@ -21,18 +21,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereVM to the Hub version (v1beta1). func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereVM) + dst := dstRaw.(*infrav1.VSphereVM) if err := Convert_v1alpha3_VSphereVM_To_v1beta1_VSphereVM(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereVM{} + restored := &infrav1.VSphereVM{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -52,7 +52,7 @@ func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereVM. func (dst *VSphereVM) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereVM) + src := srcRaw.(*infrav1.VSphereVM) if err := Convert_v1beta1_VSphereVM_To_v1alpha3_VSphereVM(src, dst, nil); err != nil { return err } @@ -67,12 +67,12 @@ func (dst *VSphereVM) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VSphereVMList to the Hub version (v1beta1). func (src *VSphereVMList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereVMList) + dst := dstRaw.(*infrav1.VSphereVMList) return Convert_v1alpha3_VSphereVMList_To_v1beta1_VSphereVMList(src, dst, nil) } // ConvertFrom converts this VSphereVM to the Hub version (v1beta1). func (dst *VSphereVMList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereVMList) + src := srcRaw.(*infrav1.VSphereVMList) return Convert_v1beta1_VSphereVMList_To_v1alpha3_VSphereVMList(src, dst, nil) } diff --git a/apis/v1alpha4/conversion.go b/apis/v1alpha4/conversion.go index 932607a521..48239de1ef 100644 --- a/apis/v1alpha4/conversion.go +++ b/apis/v1alpha4/conversion.go @@ -19,32 +19,32 @@ package v1alpha4 import ( "k8s.io/apimachinery/pkg/conversion" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec is an autogenerated conversion function. // //nolint:golint,revive,stylecheck -func Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in *v1beta1.VirtualMachineCloneSpec, out *VirtualMachineCloneSpec, s conversion.Scope) error { +func Convert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in *infrav1.VirtualMachineCloneSpec, out *VirtualMachineCloneSpec, s conversion.Scope) error { return autoConvert_v1beta1_VirtualMachineCloneSpec_To_v1alpha4_VirtualMachineCloneSpec(in, out, s) } -func Convert_v1beta1_VSphereVMStatus_To_v1alpha4_VSphereVMStatus(in *v1beta1.VSphereVMStatus, out *VSphereVMStatus, s conversion.Scope) error { +func Convert_v1beta1_VSphereVMStatus_To_v1alpha4_VSphereVMStatus(in *infrav1.VSphereVMStatus, out *VSphereVMStatus, s conversion.Scope) error { return autoConvert_v1beta1_VSphereVMStatus_To_v1alpha4_VSphereVMStatus(in, out, s) } -func Convert_v1beta1_VSphereClusterStatus_To_v1alpha4_VSphereClusterStatus(in *v1beta1.VSphereClusterStatus, out *VSphereClusterStatus, s conversion.Scope) error { +func Convert_v1beta1_VSphereClusterStatus_To_v1alpha4_VSphereClusterStatus(in *infrav1.VSphereClusterStatus, out *VSphereClusterStatus, s conversion.Scope) error { return autoConvert_v1beta1_VSphereClusterStatus_To_v1alpha4_VSphereClusterStatus(in, out, s) } -func Convert_v1beta1_VSphereClusterSpec_To_v1alpha4_VSphereClusterSpec(in *v1beta1.VSphereClusterSpec, out *VSphereClusterSpec, s conversion.Scope) error { +func Convert_v1beta1_VSphereClusterSpec_To_v1alpha4_VSphereClusterSpec(in *infrav1.VSphereClusterSpec, out *VSphereClusterSpec, s conversion.Scope) error { return autoConvert_v1beta1_VSphereClusterSpec_To_v1alpha4_VSphereClusterSpec(in, out, s) } -func Convert_v1beta1_VSphereMachineSpec_To_v1alpha4_VSphereMachineSpec(in *v1beta1.VSphereMachineSpec, out *VSphereMachineSpec, s conversion.Scope) error { +func Convert_v1beta1_VSphereMachineSpec_To_v1alpha4_VSphereMachineSpec(in *infrav1.VSphereMachineSpec, out *VSphereMachineSpec, s conversion.Scope) error { return autoConvert_v1beta1_VSphereMachineSpec_To_v1alpha4_VSphereMachineSpec(in, out, s) } -func Convert_v1beta1_VSphereVMSpec_To_v1alpha4_VSphereVMSpec(in *v1beta1.VSphereVMSpec, out *VSphereVMSpec, s conversion.Scope) error { +func Convert_v1beta1_VSphereVMSpec_To_v1alpha4_VSphereVMSpec(in *infrav1.VSphereVMSpec, out *VSphereVMSpec, s conversion.Scope) error { return autoConvert_v1beta1_VSphereVMSpec_To_v1alpha4_VSphereVMSpec(in, out, s) } diff --git a/apis/v1alpha4/networkdevicespec_conversion.go b/apis/v1alpha4/networkdevicespec_conversion.go index 1436af1d7b..042f3a84d9 100644 --- a/apis/v1alpha4/networkdevicespec_conversion.go +++ b/apis/v1alpha4/networkdevicespec_conversion.go @@ -19,10 +19,10 @@ package v1alpha4 import ( conversion "k8s.io/apimachinery/pkg/conversion" - v1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) -func Convert_v1beta1_NetworkDeviceSpec_To_v1alpha4_NetworkDeviceSpec(in *v1beta1.NetworkDeviceSpec, out *NetworkDeviceSpec, s conversion.Scope) error { +func Convert_v1beta1_NetworkDeviceSpec_To_v1alpha4_NetworkDeviceSpec(in *infrav1.NetworkDeviceSpec, out *NetworkDeviceSpec, s conversion.Scope) error { out.NetworkName = in.NetworkName out.DeviceName = in.DeviceName out.DHCP4 = in.DHCP4 diff --git a/apis/v1alpha4/types.go b/apis/v1alpha4/types.go index 9eba7f6d6c..b20e70081c 100644 --- a/apis/v1alpha4/types.go +++ b/apis/v1alpha4/types.go @@ -20,7 +20,7 @@ package v1alpha4 import ( "fmt" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -149,7 +149,7 @@ type VSphereMachineTemplateResource 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"` + ObjectMeta clusterv1alpha4.ObjectMeta `json:"metadata,omitempty"` // Spec is the specification of the desired behavior of the machine. Spec VSphereMachineSpec `json:"spec"` diff --git a/apis/v1alpha4/vspherecluster_conversion.go b/apis/v1alpha4/vspherecluster_conversion.go index 3f7ca0ab52..2f7546d717 100644 --- a/apis/v1alpha4/vspherecluster_conversion.go +++ b/apis/v1alpha4/vspherecluster_conversion.go @@ -20,29 +20,29 @@ package v1alpha4 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereCluster to the Hub version (v1beta1). func (src *VSphereCluster) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereCluster) + dst := dstRaw.(*infrav1.VSphereCluster) return Convert_v1alpha4_VSphereCluster_To_v1beta1_VSphereCluster(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereCluster. func (dst *VSphereCluster) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereCluster) + src := srcRaw.(*infrav1.VSphereCluster) return Convert_v1beta1_VSphereCluster_To_v1alpha4_VSphereCluster(src, dst, nil) } // ConvertTo converts this VSphereClusterList to the Hub version (v1beta1). func (src *VSphereClusterList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterList) + dst := dstRaw.(*infrav1.VSphereClusterList) return Convert_v1alpha4_VSphereClusterList_To_v1beta1_VSphereClusterList(src, dst, nil) } // ConvertFrom converts this VSphereVM to the Hub version (v1beta1). func (dst *VSphereClusterList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereClusterList) + src := srcRaw.(*infrav1.VSphereClusterList) return Convert_v1beta1_VSphereClusterList_To_v1alpha4_VSphereClusterList(src, dst, nil) } diff --git a/apis/v1alpha4/vspherecluster_types.go b/apis/v1alpha4/vspherecluster_types.go index 977818f592..2f3fbfc9ad 100644 --- a/apis/v1alpha4/vspherecluster_types.go +++ b/apis/v1alpha4/vspherecluster_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -55,10 +55,10 @@ type VSphereClusterStatus struct { // Conditions defines current service state of the VSphereCluster. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` // FailureDomains is a list of failure domain objects synced from the infrastructure provider. - FailureDomains clusterv1.FailureDomains `json:"failureDomains,omitempty"` + FailureDomains clusterv1alpha4.FailureDomains `json:"failureDomains,omitempty"` } // +kubebuilder:object:root=true @@ -81,11 +81,11 @@ type VSphereCluster struct { Status VSphereClusterStatus `json:"status,omitempty"` } -func (c *VSphereCluster) GetConditions() clusterv1.Conditions { +func (c *VSphereCluster) GetConditions() clusterv1alpha4.Conditions { return c.Status.Conditions } -func (c *VSphereCluster) SetConditions(conditions clusterv1.Conditions) { +func (c *VSphereCluster) SetConditions(conditions clusterv1alpha4.Conditions) { c.Status.Conditions = conditions } diff --git a/apis/v1alpha4/vsphereclusteridentity_conversion.go b/apis/v1alpha4/vsphereclusteridentity_conversion.go index b2a5b8182f..ccb227e7b4 100644 --- a/apis/v1alpha4/vsphereclusteridentity_conversion.go +++ b/apis/v1alpha4/vsphereclusteridentity_conversion.go @@ -19,29 +19,29 @@ package v1alpha4 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereClusterIdentity to the Hub version (v1beta1). func (src *VSphereClusterIdentity) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterIdentity) + dst := dstRaw.(*infrav1.VSphereClusterIdentity) return Convert_v1alpha4_VSphereClusterIdentity_To_v1beta1_VSphereClusterIdentity(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterIdentity. func (dst *VSphereClusterIdentity) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterIdentity) + src := srcRaw.(*infrav1.VSphereClusterIdentity) return Convert_v1beta1_VSphereClusterIdentity_To_v1alpha4_VSphereClusterIdentity(src, dst, nil) } // ConvertTo converts this VSphereClusterIdentityList to the Hub version (v1beta1). func (src *VSphereClusterIdentityList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterIdentityList) + dst := dstRaw.(*infrav1.VSphereClusterIdentityList) return Convert_v1alpha4_VSphereClusterIdentityList_To_v1beta1_VSphereClusterIdentityList(src, dst, nil) } // ConvertFrom converts this VSphereClusterIdentityList to the Hub version (v1beta1). func (dst *VSphereClusterIdentityList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterIdentityList) + src := srcRaw.(*infrav1.VSphereClusterIdentityList) return Convert_v1beta1_VSphereClusterIdentityList_To_v1alpha4_VSphereClusterIdentityList(src, dst, nil) } diff --git a/apis/v1alpha4/vsphereclusteridentity_types.go b/apis/v1alpha4/vsphereclusteridentity_types.go index 993582963e..799a8343f0 100644 --- a/apis/v1alpha4/vsphereclusteridentity_types.go +++ b/apis/v1alpha4/vsphereclusteridentity_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) const ( @@ -44,7 +44,7 @@ type VSphereClusterIdentityStatus struct { // Conditions defines current service state of the VSphereCluster. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } type AllowedNamespaces struct { @@ -70,11 +70,11 @@ type VSphereIdentityReference struct { Name string `json:"name"` } -func (c *VSphereClusterIdentity) GetConditions() clusterv1.Conditions { +func (c *VSphereClusterIdentity) GetConditions() clusterv1alpha4.Conditions { return c.Status.Conditions } -func (c *VSphereClusterIdentity) SetConditions(conditions clusterv1.Conditions) { +func (c *VSphereClusterIdentity) SetConditions(conditions clusterv1alpha4.Conditions) { c.Status.Conditions = conditions } diff --git a/apis/v1alpha4/vsphereclustertemplate_conversion.go b/apis/v1alpha4/vsphereclustertemplate_conversion.go index f7f76cb76a..499cb90b15 100644 --- a/apis/v1alpha4/vsphereclustertemplate_conversion.go +++ b/apis/v1alpha4/vsphereclustertemplate_conversion.go @@ -19,29 +19,29 @@ package v1alpha4 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereClusterTemplate to the Hub version (v1beta1). func (src *VSphereClusterTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterTemplate) + dst := dstRaw.(*infrav1.VSphereClusterTemplate) return Convert_v1alpha4_VSphereClusterTemplate_To_v1beta1_VSphereClusterTemplate(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereClusterTemplate. func (dst *VSphereClusterTemplate) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterTemplate) + src := srcRaw.(*infrav1.VSphereClusterTemplate) return Convert_v1beta1_VSphereClusterTemplate_To_v1alpha4_VSphereClusterTemplate(src, dst, nil) } // ConvertTo converts this VSphereClusterIdentityList to the Hub version (v1beta1). func (src *VSphereClusterTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereClusterTemplateList) + dst := dstRaw.(*infrav1.VSphereClusterTemplateList) return Convert_v1alpha4_VSphereClusterTemplateList_To_v1beta1_VSphereClusterTemplateList(src, dst, nil) } // ConvertFrom converts this VSphereClusterIdentityList to the Hub version (v1beta1). func (dst *VSphereClusterTemplateList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereClusterTemplateList) + src := srcRaw.(*infrav1.VSphereClusterTemplateList) return Convert_v1beta1_VSphereClusterTemplateList_To_v1alpha4_VSphereClusterTemplateList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheredeploymentzone_conversion.go b/apis/v1alpha4/vspheredeploymentzone_conversion.go index 7aa5387977..85fe22028b 100644 --- a/apis/v1alpha4/vspheredeploymentzone_conversion.go +++ b/apis/v1alpha4/vspheredeploymentzone_conversion.go @@ -19,29 +19,29 @@ package v1alpha4 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereDeploymentZone to the Hub version (v1beta1). func (src *VSphereDeploymentZone) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereDeploymentZone) + dst := dstRaw.(*infrav1.VSphereDeploymentZone) return Convert_v1alpha4_VSphereDeploymentZone_To_v1beta1_VSphereDeploymentZone(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereDeploymentZone. func (dst *VSphereDeploymentZone) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereDeploymentZone) + src := srcRaw.(*infrav1.VSphereDeploymentZone) return Convert_v1beta1_VSphereDeploymentZone_To_v1alpha4_VSphereDeploymentZone(src, dst, nil) } // ConvertTo converts this VSphereDeploymentZoneList to the Hub version (v1beta1). func (src *VSphereDeploymentZoneList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereDeploymentZoneList) + dst := dstRaw.(*infrav1.VSphereDeploymentZoneList) return Convert_v1alpha4_VSphereDeploymentZoneList_To_v1beta1_VSphereDeploymentZoneList(src, dst, nil) } // ConvertFrom converts this VSphereDeploymentZoneList to the Hub version (v1beta1). func (dst *VSphereDeploymentZoneList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereDeploymentZoneList) + src := srcRaw.(*infrav1.VSphereDeploymentZoneList) return Convert_v1beta1_VSphereDeploymentZoneList_To_v1alpha4_VSphereDeploymentZoneList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheredeploymentzone_types.go b/apis/v1alpha4/vspheredeploymentzone_types.go index ac2654b2b5..a1ec9a745e 100644 --- a/apis/v1alpha4/vspheredeploymentzone_types.go +++ b/apis/v1alpha4/vspheredeploymentzone_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" ) // VSphereDeploymentZoneSpec defines the desired state of VSphereDeploymentZone @@ -74,7 +74,7 @@ type VSphereDeploymentZoneStatus struct { // Conditions defines current service state of the VSphereMachine. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -93,11 +93,11 @@ type VSphereDeploymentZone struct { Status VSphereDeploymentZoneStatus `json:"status,omitempty"` } -func (z *VSphereDeploymentZone) GetConditions() clusterv1.Conditions { +func (z *VSphereDeploymentZone) GetConditions() clusterv1alpha4.Conditions { return z.Status.Conditions } -func (z *VSphereDeploymentZone) SetConditions(conditions clusterv1.Conditions) { +func (z *VSphereDeploymentZone) SetConditions(conditions clusterv1alpha4.Conditions) { z.Status.Conditions = conditions } diff --git a/apis/v1alpha4/vspherefailuredomain_conversion.go b/apis/v1alpha4/vspherefailuredomain_conversion.go index 42f7ec8d23..c1279e520b 100644 --- a/apis/v1alpha4/vspherefailuredomain_conversion.go +++ b/apis/v1alpha4/vspherefailuredomain_conversion.go @@ -19,29 +19,29 @@ package v1alpha4 import ( "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereFailureDomain to the Hub version (v1beta1). func (src *VSphereFailureDomain) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereFailureDomain) + dst := dstRaw.(*infrav1.VSphereFailureDomain) return Convert_v1alpha4_VSphereFailureDomain_To_v1beta1_VSphereFailureDomain(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereFailureDomain. func (dst *VSphereFailureDomain) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereFailureDomain) + src := srcRaw.(*infrav1.VSphereFailureDomain) return Convert_v1beta1_VSphereFailureDomain_To_v1alpha4_VSphereFailureDomain(src, dst, nil) } // ConvertTo converts this VSphereFailureDomainList to the Hub version (v1beta1). func (src *VSphereFailureDomainList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereFailureDomainList) + dst := dstRaw.(*infrav1.VSphereFailureDomainList) return Convert_v1alpha4_VSphereFailureDomainList_To_v1beta1_VSphereFailureDomainList(src, dst, nil) } // ConvertFrom converts this VSphereFailureDomainList to the Hub version (v1beta1). func (dst *VSphereFailureDomainList) ConvertFrom(srcRaw conversion.Hub) error { // nolint - src := srcRaw.(*infrav1beta1.VSphereFailureDomainList) + src := srcRaw.(*infrav1.VSphereFailureDomainList) return Convert_v1beta1_VSphereFailureDomainList_To_v1alpha4_VSphereFailureDomainList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheremachine_conversion.go b/apis/v1alpha4/vspheremachine_conversion.go index d3129fafda..4320ccb997 100644 --- a/apis/v1alpha4/vspheremachine_conversion.go +++ b/apis/v1alpha4/vspheremachine_conversion.go @@ -21,18 +21,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereMachine to the Hub version (v1beta1). func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachine) + dst := dstRaw.(*infrav1.VSphereMachine) if err := Convert_v1alpha4_VSphereMachine_To_v1beta1_VSphereMachine(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereMachine{} + restored := &infrav1.VSphereMachine{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -52,18 +52,18 @@ func (src *VSphereMachine) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereMachine. func (dst *VSphereMachine) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachine) + src := srcRaw.(*infrav1.VSphereMachine) return Convert_v1beta1_VSphereMachine_To_v1alpha4_VSphereMachine(src, dst, nil) } // ConvertTo converts this VSphereMachineList to the Hub version (v1beta1). func (src *VSphereMachineList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineList) + dst := dstRaw.(*infrav1.VSphereMachineList) return Convert_v1alpha4_VSphereMachineList_To_v1beta1_VSphereMachineList(src, dst, nil) } // ConvertFrom converts from the Hub version (v1beta1) to this VSphereMachineList. func (dst *VSphereMachineList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineList) + src := srcRaw.(*infrav1.VSphereMachineList) return Convert_v1beta1_VSphereMachineList_To_v1alpha4_VSphereMachineList(src, dst, nil) } diff --git a/apis/v1alpha4/vspheremachine_types.go b/apis/v1alpha4/vspheremachine_types.go index 2b960997e9..fc4880d90b 100644 --- a/apis/v1alpha4/vspheremachine_types.go +++ b/apis/v1alpha4/vspheremachine_types.go @@ -19,7 +19,7 @@ package v1alpha4 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -51,7 +51,7 @@ type VSphereMachineStatus struct { Ready bool `json:"ready"` // Addresses contains the VSphere instance associated addresses. - Addresses []clusterv1.MachineAddress `json:"addresses,omitempty"` + Addresses []clusterv1alpha4.MachineAddress `json:"addresses,omitempty"` // Network returns the network status for each of the machine's configured // network interfaces. @@ -98,7 +98,7 @@ type VSphereMachineStatus struct { // Conditions defines current service state of the VSphereMachine. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -122,11 +122,11 @@ type VSphereMachine struct { Status VSphereMachineStatus `json:"status,omitempty"` } -func (m *VSphereMachine) GetConditions() clusterv1.Conditions { +func (m *VSphereMachine) GetConditions() clusterv1alpha4.Conditions { return m.Status.Conditions } -func (m *VSphereMachine) SetConditions(conditions clusterv1.Conditions) { +func (m *VSphereMachine) SetConditions(conditions clusterv1alpha4.Conditions) { m.Status.Conditions = conditions } diff --git a/apis/v1alpha4/vspheremachinetemplate_conversion.go b/apis/v1alpha4/vspheremachinetemplate_conversion.go index 0cdfb0a4d5..0061d79fc3 100644 --- a/apis/v1alpha4/vspheremachinetemplate_conversion.go +++ b/apis/v1alpha4/vspheremachinetemplate_conversion.go @@ -19,23 +19,23 @@ package v1alpha4 import ( apiconversion "k8s.io/apimachinery/pkg/conversion" - clusterv1a4 "sigs.k8s.io/cluster-api/api/v1alpha4" - clusterv1b1 "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo. func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineTemplate) //nolint:forcetypeassert + dst := dstRaw.(*infrav1.VSphereMachineTemplate) //nolint:forcetypeassert if err := Convert_v1alpha4_VSphereMachineTemplate_To_v1beta1_VSphereMachineTemplate(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereMachineTemplate{} + restored := &infrav1.VSphereMachineTemplate{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -53,7 +53,7 @@ func (src *VSphereMachineTemplate) ConvertTo(dstRaw conversion.Hub) error { } func (dst *VSphereMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineTemplate) //nolint:forcetypeassert + src := srcRaw.(*infrav1.VSphereMachineTemplate) //nolint:forcetypeassert if err := Convert_v1beta1_VSphereMachineTemplate_To_v1alpha4_VSphereMachineTemplate(src, dst, nil); err != nil { return err } @@ -67,25 +67,25 @@ func (dst *VSphereMachineTemplate) ConvertFrom(srcRaw conversion.Hub) error { } func (src *VSphereMachineTemplateList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereMachineTemplateList) //nolint:forcetypeassert + dst := dstRaw.(*infrav1.VSphereMachineTemplateList) //nolint:forcetypeassert return Convert_v1alpha4_VSphereMachineTemplateList_To_v1beta1_VSphereMachineTemplateList(src, dst, nil) } func (dst *VSphereMachineTemplateList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereMachineTemplateList) //nolint:forcetypeassert + src := srcRaw.(*infrav1.VSphereMachineTemplateList) //nolint:forcetypeassert return Convert_v1beta1_VSphereMachineTemplateList_To_v1alpha4_VSphereMachineTemplateList(src, dst, nil) } // nolint -func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *clusterv1a4.ObjectMeta, out *clusterv1b1.ObjectMeta, s apiconversion.Scope) error { +func Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in *clusterv1alpha4.ObjectMeta, out *clusterv1.ObjectMeta, s apiconversion.Scope) error { // wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion() // more details at https://github.com/kubernetes/kubernetes/issues/98380 - return clusterv1a4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) + return clusterv1alpha4.Convert_v1alpha4_ObjectMeta_To_v1beta1_ObjectMeta(in, out, s) } // nolint -func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *clusterv1b1.ObjectMeta, out *clusterv1a4.ObjectMeta, s apiconversion.Scope) error { +func Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in *clusterv1.ObjectMeta, out *clusterv1alpha4.ObjectMeta, s apiconversion.Scope) error { // wrapping the conversion func to avoid having compile errors due to compileErrorOnMissingConversion() // more details at https://github.com/kubernetes/kubernetes/issues/98380 - return clusterv1a4.Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) + return clusterv1alpha4.Convert_v1beta1_ObjectMeta_To_v1alpha4_ObjectMeta(in, out, s) } diff --git a/apis/v1alpha4/vspherevm_conversion.go b/apis/v1alpha4/vspherevm_conversion.go index bdeac3c6e0..a2eece0b41 100644 --- a/apis/v1alpha4/vspherevm_conversion.go +++ b/apis/v1alpha4/vspherevm_conversion.go @@ -21,18 +21,18 @@ import ( utilconversion "sigs.k8s.io/cluster-api/util/conversion" "sigs.k8s.io/controller-runtime/pkg/conversion" - infrav1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) // ConvertTo converts this VSphereVM to the Hub version (v1beta1). func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereVM) + dst := dstRaw.(*infrav1.VSphereVM) if err := Convert_v1alpha4_VSphereVM_To_v1beta1_VSphereVM(src, dst, nil); err != nil { return err } // Manually restore data. - restored := &infrav1beta1.VSphereVM{} + restored := &infrav1.VSphereVM{} if ok, err := utilconversion.UnmarshalData(src, restored); err != nil || !ok { return err } @@ -52,7 +52,7 @@ func (src *VSphereVM) ConvertTo(dstRaw conversion.Hub) error { // ConvertFrom converts from the Hub version (v1beta1) to this VSphereVM. func (dst *VSphereVM) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereVM) + src := srcRaw.(*infrav1.VSphereVM) if err := Convert_v1beta1_VSphereVM_To_v1alpha4_VSphereVM(src, dst, nil); err != nil { return err } @@ -67,12 +67,12 @@ func (dst *VSphereVM) ConvertFrom(srcRaw conversion.Hub) error { // ConvertTo converts this VSphereVMList to the Hub version (v1beta1). func (src *VSphereVMList) ConvertTo(dstRaw conversion.Hub) error { - dst := dstRaw.(*infrav1beta1.VSphereVMList) + dst := dstRaw.(*infrav1.VSphereVMList) return Convert_v1alpha4_VSphereVMList_To_v1beta1_VSphereVMList(src, dst, nil) } // ConvertFrom converts this VSphereVM to the Hub version (v1beta1). func (dst *VSphereVMList) ConvertFrom(srcRaw conversion.Hub) error { - src := srcRaw.(*infrav1beta1.VSphereVMList) + src := srcRaw.(*infrav1.VSphereVMList) return Convert_v1beta1_VSphereVMList_To_v1alpha4_VSphereVMList(src, dst, nil) } diff --git a/apis/v1alpha4/vspherevm_types.go b/apis/v1alpha4/vspherevm_types.go index f1f25fecce..91c030548e 100644 --- a/apis/v1alpha4/vspherevm_types.go +++ b/apis/v1alpha4/vspherevm_types.go @@ -20,7 +20,7 @@ package v1alpha4 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - clusterv1 "sigs.k8s.io/cluster-api/api/v1alpha4" + clusterv1alpha4 "sigs.k8s.io/cluster-api/api/v1alpha4" "sigs.k8s.io/cluster-api/errors" ) @@ -122,7 +122,7 @@ type VSphereVMStatus struct { // Conditions defines current service state of the VSphereVM. // +optional - Conditions clusterv1.Conditions `json:"conditions,omitempty"` + Conditions clusterv1alpha4.Conditions `json:"conditions,omitempty"` } // +kubebuilder:object:root=true @@ -141,11 +141,11 @@ type VSphereVM struct { Status VSphereVMStatus `json:"status,omitempty"` } -func (r *VSphereVM) GetConditions() clusterv1.Conditions { +func (r *VSphereVM) GetConditions() clusterv1alpha4.Conditions { return r.Status.Conditions } -func (r *VSphereVM) SetConditions(conditions clusterv1.Conditions) { +func (r *VSphereVM) SetConditions(conditions clusterv1alpha4.Conditions) { r.Status.Conditions = conditions } diff --git a/apis/vmware/v1beta1/vspheremachine_types.go b/apis/vmware/v1beta1/vspheremachine_types.go index 1563cbce85..fec9bcdccf 100644 --- a/apis/vmware/v1beta1/vspheremachine_types.go +++ b/apis/vmware/v1beta1/vspheremachine_types.go @@ -18,7 +18,7 @@ limitations under the License. package v1beta1 import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/errors" @@ -29,7 +29,7 @@ type VSphereMachineVolume struct { // Name is suffix used to name this PVC as: VSphereMachine.Name + "-" + Name Name string `json:"name"` // Capacity is the PVC capacity - Capacity v1.ResourceList `json:"capacity"` + Capacity corev1.ResourceList `json:"capacity"` // StorageClass defaults to VSphereMachineSpec.StorageClass // +optional StorageClass string `json:"storageClass,omitempty"` @@ -90,7 +90,7 @@ type VSphereMachineStatus struct { Ready bool `json:"ready"` // Addresses contains the instance associated addresses. - Addresses []v1.NodeAddress `json:"addresses,omitempty"` + Addresses []corev1.NodeAddress `json:"addresses,omitempty"` // ID is used to identify the virtual machine. // +optional diff --git a/controllers/svcdiscovery_controller_suite_test.go b/controllers/svcdiscovery_controller_suite_test.go index 5f7b91b2f3..f50e1d4fa6 100644 --- a/controllers/svcdiscovery_controller_suite_test.go +++ b/controllers/svcdiscovery_controller_suite_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" - vmwarev1beta1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" ) const ( @@ -119,9 +119,9 @@ func assertHeadlessSvcWithFIPHostNameEndpoints(ctx context.Context, guestClient Expect(headlessEndpoints.Subsets[0].Ports[0].Port).To(Equal(int32(testSupervisorAPIServerPort))) } -func assertServiceDiscoveryCondition(vsphereCluster *vmwarev1beta1.VSphereCluster, status corev1.ConditionStatus, +func assertServiceDiscoveryCondition(vsphereCluster *vmwarev1.VSphereCluster, status corev1.ConditionStatus, message string, reason string, severity clusterv1.ConditionSeverity) { - c := conditions.Get(vsphereCluster, vmwarev1beta1.ServiceDiscoveryReadyCondition) + c := conditions.Get(vsphereCluster, vmwarev1.ServiceDiscoveryReadyCondition) Expect(c).NotTo(BeNil()) if message == "" { Expect(c.Message).To(BeEmpty()) diff --git a/controllers/svcdiscovery_controller_unit_test.go b/controllers/svcdiscovery_controller_unit_test.go index 1d25ba65d3..58dc8b3806 100644 --- a/controllers/svcdiscovery_controller_unit_test.go +++ b/controllers/svcdiscovery_controller_unit_test.go @@ -25,7 +25,7 @@ import ( capiutil "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/fake" helpers "sigs.k8s.io/cluster-api-provider-vsphere/test/helpers/vmware" ) @@ -35,7 +35,7 @@ var _ = Describe("ServiceDiscoveryReconciler ReconcileNormal", serviceDiscoveryU func serviceDiscoveryUnitTestsReconcileNormal() { var ( ctx *helpers.UnitTestContextForController - vsphereCluster vmwarev1b1.VSphereCluster + vsphereCluster vmwarev1.VSphereCluster initObjects []client.Object reconciler serviceDiscoveryReconciler ) @@ -58,7 +58,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { By("creating a service and no endpoint in the guest cluster") assertHeadlessSvcWithNoEndpoints(ctx, ctx.GuestClient, supervisorHeadlessSvcNamespace, supervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionFalse, "Unable to discover supervisor apiserver address", - vmwarev1b1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) + vmwarev1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) }) }) Context("When VIP is available", func() { @@ -70,7 +70,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { }) It("Should reconcile headless svc", func() { By("creating a service and endpoints using the VIP in the guest cluster") - assertHeadlessSvcWithVIPEndpoints(ctx, ctx.GuestClient, vmwarev1b1.SupervisorHeadlessSvcNamespace, vmwarev1b1.SupervisorHeadlessSvcName) + assertHeadlessSvcWithVIPEndpoints(ctx, ctx.GuestClient, vmwarev1.SupervisorHeadlessSvcNamespace, vmwarev1.SupervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionTrue, "", "", "") }) It("Should get supervisor master endpoint IP", func() { @@ -136,7 +136,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { By("creating a service and no endpoint in the guest cluster") assertHeadlessSvcWithNoEndpoints(ctx, ctx.GuestClient, supervisorHeadlessSvcNamespace, supervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionFalse, "Unable to discover supervisor apiserver address", - vmwarev1b1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) + vmwarev1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) }) }) Context("When FIP is an invalid host", func() { @@ -149,7 +149,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { By("creating a service and no endpoint in the guest cluster") assertHeadlessSvcWithNoEndpoints(ctx, ctx.GuestClient, supervisorHeadlessSvcNamespace, supervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionFalse, "Unable to discover supervisor apiserver address", - vmwarev1b1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) + vmwarev1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) }) }) Context("When FIP config map has invalid kubeconfig data", func() { @@ -165,7 +165,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { By("creating a service and no endpoint in the guest cluster") assertHeadlessSvcWithNoEndpoints(ctx, ctx.GuestClient, supervisorHeadlessSvcNamespace, supervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionFalse, "Unable to discover supervisor apiserver address", - vmwarev1b1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) + vmwarev1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) }) }) Context("When FIP config map has invalid kubeconfig key", func() { @@ -181,7 +181,7 @@ func serviceDiscoveryUnitTestsReconcileNormal() { By("creating a service and no endpoint in the guest cluster") assertHeadlessSvcWithNoEndpoints(ctx, ctx.GuestClient, supervisorHeadlessSvcNamespace, supervisorHeadlessSvcName) assertServiceDiscoveryCondition(ctx.VSphereCluster, corev1.ConditionFalse, "Unable to discover supervisor apiserver address", - vmwarev1b1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) + vmwarev1.SupervisorHeadlessServiceSetupFailedReason, clusterv1.ConditionSeverityWarning) }) }) } diff --git a/controllers/vmware/vspherecluster_reconciler_test.go b/controllers/vmware/vspherecluster_reconciler_test.go index 74ee9c9fc8..d9964cba33 100644 --- a/controllers/vmware/vspherecluster_reconciler_test.go +++ b/controllers/vmware/vspherecluster_reconciler_test.go @@ -28,7 +28,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/network" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/vmoperator" @@ -52,8 +52,8 @@ var _ = Describe("Cluster Controller Tests", func() { ) var ( cluster *clusterv1.Cluster - vsphereCluster *infrav1.VSphereCluster - vsphereMachine *infrav1.VSphereMachine + vsphereCluster *vmwarev1.VSphereCluster + vsphereMachine *vmwarev1.VSphereMachine ctx *vmware.ClusterContext reconciler *ClusterReconciler ) @@ -94,9 +94,9 @@ var _ = Describe("Cluster Controller Tests", func() { Context("Test reconcileDelete", func() { It("should mark specific resources to be in deleting conditions", func() { ctx.VSphereCluster.Status.Conditions = append(ctx.VSphereCluster.Status.Conditions, - clusterv1.Condition{Type: infrav1.ResourcePolicyReadyCondition, Status: corev1.ConditionTrue}) + clusterv1.Condition{Type: vmwarev1.ResourcePolicyReadyCondition, Status: corev1.ConditionTrue}) reconciler.reconcileDelete(ctx) - c := conditions.Get(ctx.VSphereCluster, infrav1.ResourcePolicyReadyCondition) + c := conditions.Get(ctx.VSphereCluster, vmwarev1.ResourcePolicyReadyCondition) Expect(c).NotTo(BeNil()) Expect(c.Status).To(Equal(corev1.ConditionFalse)) Expect(c.Reason).To(Equal(clusterv1.DeletingReason)) diff --git a/controllers/vspherecluster_reconciler.go b/controllers/vspherecluster_reconciler.go index 73aa309b42..b17588bdb1 100644 --- a/controllers/vspherecluster_reconciler.go +++ b/controllers/vspherecluster_reconciler.go @@ -24,7 +24,7 @@ import ( "time" "github.com/pkg/errors" - apiv1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" @@ -186,7 +186,7 @@ func (r clusterReconciler) reconcileDelete(ctx *context.ClusterContext) (reconci // Remove finalizer on Identity Secret if identity.IsSecretIdentity(ctx.VSphereCluster) { - secret := &apiv1.Secret{} + secret := &corev1.Secret{} secretKey := client.ObjectKey{ Namespace: ctx.VSphereCluster.Namespace, Name: ctx.VSphereCluster.Spec.IdentityRef.Name, @@ -285,7 +285,7 @@ func (r clusterReconciler) reconcileNormal(ctx *context.ClusterContext) (reconci func (r clusterReconciler) reconcileIdentitySecret(ctx *context.ClusterContext) error { vsphereCluster := ctx.VSphereCluster if identity.IsSecretIdentity(vsphereCluster) { - secret := &apiv1.Secret{} + secret := &corev1.Secret{} secretKey := client.ObjectKey{ Namespace: vsphereCluster.Namespace, Name: vsphereCluster.Spec.IdentityRef.Name, diff --git a/controllers/vspheredeploymentzone_controller_domain.go b/controllers/vspheredeploymentzone_controller_domain.go index 5437825b63..663ef32701 100644 --- a/controllers/vspheredeploymentzone_controller_domain.go +++ b/controllers/vspheredeploymentzone_controller_domain.go @@ -18,7 +18,7 @@ package controllers import ( "github.com/pkg/errors" - apierrors "k8s.io/apimachinery/pkg/util/errors" + kerrors "k8s.io/apimachinery/pkg/util/errors" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" ctrl "sigs.k8s.io/controller-runtime" @@ -185,5 +185,5 @@ func (r vsphereDeploymentZoneReconciler) createAndAttachMetadata(ctx *context.VS errList = append(errList, errors.Wrapf(err, "failed to attach tag")) } } - return apierrors.NewAggregate(errList) + return kerrors.NewAggregate(errList) } diff --git a/controllers/vspherevm_controller.go b/controllers/vspherevm_controller.go index 2f187c41c0..6387165b25 100644 --- a/controllers/vspherevm_controller.go +++ b/controllers/vspherevm_controller.go @@ -24,7 +24,7 @@ import ( "time" "github.com/pkg/errors" - apiv1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" apitypes "k8s.io/apimachinery/pkg/types" @@ -385,7 +385,7 @@ func (r vmReconciler) deleteNode(ctx *context.VMContext, name string) (reconcile } // Attempt to delete the corresponding node - node := &apiv1.Node{ + node := &corev1.Node{ ObjectMeta: metav1.ObjectMeta{ Name: name, }, diff --git a/main.go b/main.go index 81a09edf4f..48b625531d 100644 --- a/main.go +++ b/main.go @@ -46,8 +46,8 @@ import ( ctrlsig "sigs.k8s.io/controller-runtime/pkg/manager/signals" "sigs.k8s.io/controller-runtime/pkg/webhook" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/controllers" "sigs.k8s.io/cluster-api-provider-vsphere/feature" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/constants" @@ -258,7 +258,7 @@ func main() { } // Check for non-supervisor VSphereCluster and start controller if found - gvr := v1beta1.GroupVersion.WithResource(reflect.TypeOf(&v1beta1.VSphereCluster{}).Elem().Name()) + gvr := infrav1.GroupVersion.WithResource(reflect.TypeOf(&infrav1.VSphereCluster{}).Elem().Name()) isLoaded, err := isCRDDeployed(mgr, gvr) if err != nil { return err @@ -272,7 +272,7 @@ func main() { } // Check for supervisor VSphereCluster and start controller if found - gvr = vmwarev1b1.GroupVersion.WithResource(reflect.TypeOf(&vmwarev1b1.VSphereCluster{}).Elem().Name()) + gvr = vmwarev1.GroupVersion.WithResource(reflect.TypeOf(&vmwarev1.VSphereCluster{}).Elem().Name()) isLoaded, err = isCRDDeployed(mgr, gvr) if err != nil { return err @@ -326,34 +326,34 @@ func main() { } func setupVAPIControllers(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager, tracker *remote.ClusterCacheTracker) error { - if err := (&v1beta1.VSphereClusterTemplate{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereClusterTemplate{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := (&v1beta1.VSphereMachine{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereMachine{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := (&v1beta1.VSphereMachineTemplateWebhook{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereMachineTemplateWebhook{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := (&v1beta1.VSphereVM{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereVM{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := (&v1beta1.VSphereDeploymentZone{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereDeploymentZone{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := (&v1beta1.VSphereFailureDomain{}).SetupWebhookWithManager(mgr); err != nil { + if err := (&infrav1.VSphereFailureDomain{}).SetupWebhookWithManager(mgr); err != nil { return err } - if err := controllers.AddClusterControllerToManager(ctx, mgr, &v1beta1.VSphereCluster{}, concurrency(vSphereClusterConcurrency)); err != nil { + if err := controllers.AddClusterControllerToManager(ctx, mgr, &infrav1.VSphereCluster{}, concurrency(vSphereClusterConcurrency)); err != nil { return err } - if err := controllers.AddMachineControllerToManager(ctx, mgr, &v1beta1.VSphereMachine{}, concurrency(vSphereMachineConcurrency)); err != nil { + if err := controllers.AddMachineControllerToManager(ctx, mgr, &infrav1.VSphereMachine{}, concurrency(vSphereMachineConcurrency)); err != nil { return err } if err := controllers.AddVMControllerToManager(ctx, mgr, tracker, concurrency(vSphereVMConcurrency)); err != nil { @@ -367,11 +367,11 @@ func setupVAPIControllers(ctx *context.ControllerManagerContext, mgr ctrlmgr.Man } func setupSupervisorControllers(ctx *context.ControllerManagerContext, mgr ctrlmgr.Manager, tracker *remote.ClusterCacheTracker) error { - if err := controllers.AddClusterControllerToManager(ctx, mgr, &vmwarev1b1.VSphereCluster{}, concurrency(vSphereClusterConcurrency)); err != nil { + if err := controllers.AddClusterControllerToManager(ctx, mgr, &vmwarev1.VSphereCluster{}, concurrency(vSphereClusterConcurrency)); err != nil { return err } - if err := controllers.AddMachineControllerToManager(ctx, mgr, &vmwarev1b1.VSphereMachine{}, concurrency(vSphereMachineConcurrency)); err != nil { + if err := controllers.AddMachineControllerToManager(ctx, mgr, &vmwarev1.VSphereMachine{}, concurrency(vSphereMachineConcurrency)); err != nil { return err } diff --git a/packaging/flavorgen/flavors/crs/util.go b/packaging/flavorgen/flavors/crs/util.go index 4272a88ee8..7f0a9a9bf5 100644 --- a/packaging/flavorgen/flavors/crs/util.go +++ b/packaging/flavorgen/flavors/crs/util.go @@ -17,7 +17,7 @@ limitations under the License. package crs import ( - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" addonsv1 "sigs.k8s.io/cluster-api/exp/addons/api/v1beta1" @@ -27,10 +27,10 @@ import ( "sigs.k8s.io/cluster-api-provider-vsphere/packaging/flavorgen/flavors/util" ) -func newSecret(name string, o runtime.Object) *v1.Secret { - return &v1.Secret{ +func newSecret(name string, o runtime.Object) *corev1.Secret { + return &corev1.Secret{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1.SchemeGroupVersion.String(), + APIVersion: corev1.SchemeGroupVersion.String(), Kind: "Secret", }, ObjectMeta: metav1.ObjectMeta{ @@ -44,17 +44,17 @@ func newSecret(name string, o runtime.Object) *v1.Secret { } } -func appendSecretToCrsResource(crs *addonsv1.ClusterResourceSet, generatedSecret *v1.Secret) { +func appendSecretToCrsResource(crs *addonsv1.ClusterResourceSet, generatedSecret *corev1.Secret) { crs.Spec.Resources = append(crs.Spec.Resources, addonsv1.ResourceRef{ Name: generatedSecret.Name, Kind: "Secret", }) } -func newConfigMap(name string, o runtime.Object) *v1.ConfigMap { - return &v1.ConfigMap{ +func newConfigMap(name string, o runtime.Object) *corev1.ConfigMap { + return &corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1.SchemeGroupVersion.String(), + APIVersion: corev1.SchemeGroupVersion.String(), Kind: "ConfigMap", }, ObjectMeta: metav1.ObjectMeta{ @@ -67,10 +67,10 @@ func newConfigMap(name string, o runtime.Object) *v1.ConfigMap { } } -func newConfigMapManifests(name string, o []runtime.Object) *v1.ConfigMap { - return &v1.ConfigMap{ +func newConfigMapManifests(name string, o []runtime.Object) *corev1.ConfigMap { + return &corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ - APIVersion: v1.SchemeGroupVersion.String(), + APIVersion: corev1.SchemeGroupVersion.String(), Kind: "ConfigMap", }, ObjectMeta: metav1.ObjectMeta{ @@ -83,7 +83,7 @@ func newConfigMapManifests(name string, o []runtime.Object) *v1.ConfigMap { } } -func appendConfigMapToCrsResource(crs *addonsv1.ClusterResourceSet, generatedConfigMap *v1.ConfigMap) { +func appendConfigMapToCrsResource(crs *addonsv1.ClusterResourceSet, generatedConfigMap *corev1.ConfigMap) { crs.Spec.Resources = append(crs.Spec.Resources, addonsv1.ResourceRef{ Name: generatedConfigMap.Name, Kind: "ConfigMap", diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 868bc108e4..b3135c61c8 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -19,7 +19,7 @@ package constants import ( "time" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) const ( @@ -45,11 +45,11 @@ const ( // MachineReadyAnnotationLabel is the annotation used to indicate that a // machine is ready. - MachineReadyAnnotationLabel = "capv." + v1beta1.GroupName + "/machine-ready" + MachineReadyAnnotationLabel = "capv." + infrav1.GroupName + "/machine-ready" // MaintenanceAnnotationLabel is the annotation used to indicate a machine and/or // cluster are in maintenance mode. - MaintenanceAnnotationLabel = "capv." + v1beta1.GroupName + "/maintenance" + MaintenanceAnnotationLabel = "capv." + infrav1.GroupName + "/maintenance" // DefaultEnableKeepAlive is true by default. DefaultEnableKeepAlive = true diff --git a/pkg/context/fake/fake_guest_cluster_context.go b/pkg/context/fake/fake_guest_cluster_context.go index f495d65e6b..9072ac8fd4 100644 --- a/pkg/context/fake/fake_guest_cluster_context.go +++ b/pkg/context/fake/fake_guest_cluster_context.go @@ -17,7 +17,7 @@ limitations under the License. package fake import ( - apiextv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" + apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/client-go/kubernetes/scheme" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -43,7 +43,7 @@ func NewGuestClusterContext(ctx *vmware.ClusterContext, prototypeCluster bool, g func NewFakeGuestClusterClient(initObjects ...client.Object) client.Client { scheme := scheme.Scheme - _ = apiextv1.AddToScheme(scheme) + _ = apiextensionsv1.AddToScheme(scheme) return fake.NewClientBuilder().WithScheme(scheme).WithObjects(initObjects...).Build() } diff --git a/pkg/context/fake/fake_vmware_cluster_context.go b/pkg/context/fake/fake_vmware_cluster_context.go index ae1954f271..570b15ed10 100644 --- a/pkg/context/fake/fake_vmware_cluster_context.go +++ b/pkg/context/fake/fake_vmware_cluster_context.go @@ -17,14 +17,14 @@ limitations under the License. package fake import ( - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" ) // NewVmwareClusterContext returns a fake ClusterContext for unit testing // reconcilers with a fake client. -func NewVmwareClusterContext(ctx *context.ControllerContext, namespace string, vsphereCluster *infrav1.VSphereCluster) *vmware.ClusterContext { +func NewVmwareClusterContext(ctx *context.ControllerContext, namespace string, vsphereCluster *vmwarev1.VSphereCluster) *vmware.ClusterContext { // Create the cluster resources. cluster := newClusterV1() if vsphereCluster == nil { diff --git a/pkg/context/interfaces.go b/pkg/context/interfaces.go index ac0823cf00..bea702b10c 100644 --- a/pkg/context/interfaces.go +++ b/pkg/context/interfaces.go @@ -18,7 +18,7 @@ package context import ( "github.com/go-logr/logr" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" @@ -29,7 +29,7 @@ type MachineContext interface { Patch() error GetLogger() logr.Logger GetVSphereMachine() VSphereMachine - GetObjectMeta() v1.ObjectMeta + GetObjectMeta() metav1.ObjectMeta GetCluster() *clusterv1.Cluster GetMachine() *clusterv1.Machine SetBaseMachineContext(base *BaseMachineContext) diff --git a/pkg/context/machine_context.go b/pkg/context/machine_context.go index 7b1e882fba..92cf34d9fb 100644 --- a/pkg/context/machine_context.go +++ b/pkg/context/machine_context.go @@ -20,7 +20,7 @@ import ( "fmt" "github.com/go-logr/logr" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/patch" @@ -69,7 +69,7 @@ func (c *VIMMachineContext) GetVSphereMachine() VSphereMachine { return c.VSphereMachine } -func (c *VIMMachineContext) GetObjectMeta() v1.ObjectMeta { +func (c *VIMMachineContext) GetObjectMeta() metav1.ObjectMeta { return c.VSphereMachine.ObjectMeta } diff --git a/pkg/context/vmware/cluster_context.go b/pkg/context/vmware/cluster_context.go index 592e70a35d..42bccb6fe6 100644 --- a/pkg/context/vmware/cluster_context.go +++ b/pkg/context/vmware/cluster_context.go @@ -24,7 +24,7 @@ import ( "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context" ) @@ -32,7 +32,7 @@ import ( type ClusterContext struct { *context.ControllerContext Cluster *clusterv1.Cluster - VSphereCluster *vmwarev1b1.VSphereCluster + VSphereCluster *vmwarev1.VSphereCluster PatchHelper *patch.Helper Logger logr.Logger } @@ -47,9 +47,9 @@ func (c *ClusterContext) Patch() error { // always update the readyCondition. conditions.SetSummary(c.VSphereCluster, conditions.WithConditions( - vmwarev1b1.ResourcePolicyReadyCondition, - vmwarev1b1.ClusterNetworkReadyCondition, - vmwarev1b1.LoadBalancerReadyCondition, + vmwarev1.ResourcePolicyReadyCondition, + vmwarev1.ClusterNetworkReadyCondition, + vmwarev1.LoadBalancerReadyCondition, ), ) return c.PatchHelper.Patch(c, c.VSphereCluster) diff --git a/pkg/context/vmware/machine_context.go b/pkg/context/vmware/machine_context.go index b0d650053c..a54332ad96 100644 --- a/pkg/context/vmware/machine_context.go +++ b/pkg/context/vmware/machine_context.go @@ -19,7 +19,7 @@ package vmware import ( "fmt" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" @@ -52,7 +52,7 @@ func (c *SupervisorMachineContext) GetVSphereMachine() context.VSphereMachine { return c.VSphereMachine } -func (c *SupervisorMachineContext) GetObjectMeta() v1.ObjectMeta { +func (c *SupervisorMachineContext) GetObjectMeta() metav1.ObjectMeta { return c.VSphereMachine.ObjectMeta } diff --git a/pkg/identity/identity.go b/pkg/identity/identity.go index 420cb4676c..ced2487c92 100644 --- a/pkg/identity/identity.go +++ b/pkg/identity/identity.go @@ -22,7 +22,7 @@ import ( "fmt" "strings" - apiv1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "sigs.k8s.io/controller-runtime/pkg/client" @@ -46,7 +46,7 @@ func GetCredentials(ctx context.Context, c client.Client, cluster *infrav1.VSphe } ref := cluster.Spec.IdentityRef - secret := &apiv1.Secret{} + secret := &corev1.Secret{} var secretKey client.ObjectKey switch ref.Kind { @@ -77,7 +77,7 @@ func GetCredentials(ctx context.Context, c client.Client, cluster *infrav1.VSphe return nil, errors.New("failed to build selector") } - ns := &apiv1.Namespace{} + ns := &corev1.Namespace{} nsKey := client.ObjectKey{ Name: cluster.Namespace, } @@ -144,7 +144,7 @@ func IsOwnedByIdentityOrCluster(ownerReferences []metav1.OwnerReference) bool { return false } -func getData(secret *apiv1.Secret, key string) string { +func getData(secret *corev1.Secret, key string) string { if secret.Data == nil { return "" } diff --git a/pkg/manager/manager.go b/pkg/manager/manager.go index 5db654771f..6a4dedd71f 100644 --- a/pkg/manager/manager.go +++ b/pkg/manager/manager.go @@ -34,10 +34,10 @@ import ( ipamv1 "sigs.k8s.io/cluster-api/exp/ipam/api/v1alpha1" ctrl "sigs.k8s.io/controller-runtime" - infrav1a3 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha3" - infrav1a4 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha4" - infrav1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + infrav1alpha3 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha3" + infrav1alpha4 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1alpha4" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/record" ) @@ -57,12 +57,12 @@ func New(opts Options) (Manager, error) { _ = clientgoscheme.AddToScheme(opts.Scheme) _ = clusterv1.AddToScheme(opts.Scheme) - _ = infrav1a3.AddToScheme(opts.Scheme) - _ = infrav1a4.AddToScheme(opts.Scheme) - _ = infrav1b1.AddToScheme(opts.Scheme) + _ = infrav1alpha3.AddToScheme(opts.Scheme) + _ = infrav1alpha4.AddToScheme(opts.Scheme) + _ = infrav1.AddToScheme(opts.Scheme) _ = controlplanev1.AddToScheme(opts.Scheme) _ = bootstrapv1.AddToScheme(opts.Scheme) - _ = vmwarev1b1.AddToScheme(opts.Scheme) + _ = vmwarev1.AddToScheme(opts.Scheme) _ = vmoprv1.AddToScheme(opts.Scheme) _ = ncpv1.AddToScheme(opts.Scheme) _ = netopv1.AddToScheme(opts.Scheme) diff --git a/pkg/services/govmomi/vcenter/clone_test.go b/pkg/services/govmomi/vcenter/clone_test.go index 36ab7635be..cf1c3e9c10 100644 --- a/pkg/services/govmomi/vcenter/clone_test.go +++ b/pkg/services/govmomi/vcenter/clone_test.go @@ -29,7 +29,7 @@ import ( _ "github.com/vmware/govmomi/vapi/simulator" "github.com/vmware/govmomi/vim25/types" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/session" ) @@ -114,12 +114,12 @@ func TestGetDiskSpec(t *testing.T) { for _, test := range testCases { tc := test t.Run(tc.name, func(t *testing.T) { - cloneSpec := v1beta1.VirtualMachineCloneSpec{ + cloneSpec := infrav1.VirtualMachineCloneSpec{ DiskGiB: tc.cloneDiskSize, AdditionalDisksGiB: tc.additionalCloneDiskSizes, } - vsphereVM := &v1beta1.VSphereVM{ - Spec: v1beta1.VSphereVMSpec{ + vsphereVM := &infrav1.VSphereVM{ + Spec: infrav1.VSphereVMSpec{ VirtualMachineCloneSpec: cloneSpec, }, } diff --git a/pkg/services/network/dummy_provider.go b/pkg/services/network/dummy_provider.go index f5f89517d8..1144bb04c6 100644 --- a/pkg/services/network/dummy_provider.go +++ b/pkg/services/network/dummy_provider.go @@ -18,7 +18,7 @@ limitations under the License. package network import ( - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" @@ -45,7 +45,7 @@ func (np *dummyNetworkProvider) GetClusterNetworkName(ctx *vmware.ClusterContext return "", nil } -func (np *dummyNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmopv1.VirtualMachine) error { +func (np *dummyNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error { return nil } diff --git a/pkg/services/network/netop_provider.go b/pkg/services/network/netop_provider.go index df2a5f5629..d4922f9afa 100644 --- a/pkg/services/network/netop_provider.go +++ b/pkg/services/network/netop_provider.go @@ -20,12 +20,12 @@ import ( "fmt" netopv1 "github.com/vmware-tanzu/net-operator-api/api/v1alpha1" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/client" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services" ) @@ -45,7 +45,7 @@ func (np *netopNetworkProvider) HasLoadBalancer() bool { } func (np *netopNetworkProvider) ProvisionClusterNetwork(ctx *vmware.ClusterContext) error { - conditions.MarkTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition) + conditions.MarkTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition) return nil } @@ -102,7 +102,7 @@ func (np *netopNetworkProvider) GetVMServiceAnnotations(ctx *vmware.ClusterConte return map[string]string{NetOpNetworkNameAnnotation: networkName}, nil } -func (np *netopNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmopv1.VirtualMachine) error { +func (np *netopNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error { network, err := np.getClusterNetwork(ctx) if err != nil { return err @@ -115,7 +115,7 @@ func (np *netopNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterConte } } - vm.Spec.NetworkInterfaces = append(vm.Spec.NetworkInterfaces, vmopv1.VirtualMachineNetworkInterface{ + vm.Spec.NetworkInterfaces = append(vm.Spec.NetworkInterfaces, vmoprv1.VirtualMachineNetworkInterface{ NetworkName: network.Name, NetworkType: string(network.Spec.Type), }) diff --git a/pkg/services/network/network_test.go b/pkg/services/network/network_test.go index 3367cc0ae9..42e23a8ae1 100644 --- a/pkg/services/network/network_test.go +++ b/pkg/services/network/network_test.go @@ -22,9 +22,9 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" netopv1alpha1 "github.com/vmware-tanzu/net-operator-api/api/v1alpha1" - "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ncpv1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" apitypes "k8s.io/apimachinery/pkg/types" @@ -33,7 +33,7 @@ import ( runtimeclient "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client/fake" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/util" @@ -69,8 +69,8 @@ var _ = Describe("Network provider", func() { err error np services.NetworkProvider cluster *clusterv1.Cluster - vSphereCluster *infrav1.VSphereCluster - vm *v1alpha1.VirtualMachine + vSphereCluster *vmwarev1.VSphereCluster + vm *vmoprv1.VirtualMachine hasLB bool ) BeforeEach(func() { @@ -84,16 +84,16 @@ var _ = Describe("Network provider", func() { Namespace: dummyNs, }, Spec: clusterv1.ClusterSpec{ - InfrastructureRef: &v1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + InfrastructureRef: &corev1.ObjectReference{ + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraClusterKind, Name: dummyCluster, }, }, } - vSphereCluster = &infrav1.VSphereCluster{ + vSphereCluster = &vmwarev1.VSphereCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraClusterKind, }, ObjectMeta: metav1.ObjectMeta{ @@ -102,7 +102,7 @@ var _ = Describe("Network provider", func() { }, } ctx = util.CreateClusterContext(cluster, vSphereCluster) - vm = &v1alpha1.VirtualMachine{ + vm = &vmoprv1.VirtualMachine{ ObjectMeta: metav1.ObjectMeta{ Namespace: dummyNs, Name: dummyVM, @@ -221,7 +221,7 @@ var _ = Describe("Network provider", func() { }, }, } - configmapObj = &v1.ConfigMap{ + configmapObj = &corev1.ConfigMap{ TypeMeta: metav1.TypeMeta{ Kind: "ConfigMap", APIVersion: "v1", @@ -234,7 +234,7 @@ var _ = Describe("Network provider", func() { util.NCPVersionKey: util.NCPVersionSupportFW, }, } - systemNamespaceObj = &v1.Namespace{ + systemNamespaceObj = &corev1.Namespace{ TypeMeta: metav1.TypeMeta{ Kind: "Namespace", APIVersion: "v1", @@ -253,7 +253,7 @@ var _ = Describe("Network provider", func() { } scheme = runtime.NewScheme() Expect(ncpv1.AddToScheme(scheme)).To(Succeed()) - Expect(v1.AddToScheme(scheme)).To(Succeed()) + Expect(corev1.AddToScheme(scheme)).To(Succeed()) }) Context("with dummy network provider", func() { @@ -284,7 +284,7 @@ var _ = Describe("Network provider", func() { }) It("should succeed", func() { Expect(err).To(BeNil()) - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) @@ -318,7 +318,7 @@ var _ = Describe("Network provider", func() { annotations, err := np.GetVMServiceAnnotations(ctx) Expect(err).ToNot(HaveOccurred()) Expect(annotations).To(HaveKeyWithValue("ncp.vmware.com/virtual-network-name", GetNSXTVirtualNetworkName(ctx.VSphereCluster.Name))) - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) @@ -345,7 +345,7 @@ var _ = Describe("Network provider", func() { Expect(err).To(BeNil()) Expect(createdVNET.Spec.WhitelistSourceRanges).To(BeEmpty()) - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) @@ -372,7 +372,7 @@ var _ = Describe("Network provider", func() { Expect(err).To(BeNil()) Expect(createdVNET.Spec.WhitelistSourceRanges).To(Equal(fakeSNATIP + "/32")) - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) @@ -401,14 +401,14 @@ var _ = Describe("Network provider", func() { Expect(createdVNET.Spec.WhitelistSourceRanges).To(Equal(fakeSNATIP + "/32")) // err is not empty, but it is because vnetObj does not have status mocked in this test - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) Context("with nsx-t network provider and FW enabled and NCP version < 3.0.1 and VNET exists", func() { BeforeEach(func() { // test if NCP version is 3.0.0 - configmapObj.(*v1.ConfigMap).Data[util.NCPVersionKey] = "3.0.0" + configmapObj.(*corev1.ConfigMap).Data[util.NCPVersionKey] = "3.0.0" client = fake.NewClientBuilder().WithScheme(scheme).WithRuntimeObjects(runtimeObjs...).Build() nsxNp, _ = NsxtNetworkProvider(client, "false").(*nsxtNetworkProvider) np = nsxNp @@ -431,12 +431,12 @@ var _ = Describe("Network provider", func() { Expect(createdVNET.Spec.WhitelistSourceRanges).To(BeEmpty()) // err is not empty, but it is because vnetObj does not have status mocked in this test - Expect(conditions.IsTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) AfterEach(func() { // change NCP version back - configmapObj.(*v1.ConfigMap).Data[util.NCPVersionKey] = util.NCPVersionSupportFW + configmapObj.(*corev1.ConfigMap).Data[util.NCPVersionKey] = util.NCPVersionSupportFW }) }) @@ -469,7 +469,7 @@ var _ = Describe("Network provider", func() { expectedErrorMessage := fmt.Sprintf("virtual network ready status is: '%s' in cluster %s. reason: %s, message: %s", "False", apitypes.NamespacedName{Namespace: dummyNs, Name: dummyCluster}, testVnetNotRealizedReason, testVnetNotRealizedMessage) Expect(err).To(MatchError(expectedErrorMessage)) - Expect(conditions.IsFalse(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition)).To(BeTrue()) + Expect(conditions.IsFalse(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition)).To(BeTrue()) }) }) }) diff --git a/pkg/services/network/nsxt_provider.go b/pkg/services/network/nsxt_provider.go index 49439da05e..d55ea4a888 100644 --- a/pkg/services/network/nsxt_provider.go +++ b/pkg/services/network/nsxt_provider.go @@ -20,7 +20,7 @@ import ( "fmt" "github.com/pkg/errors" - vmopv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" + vmoprv1 "github.com/vmware-tanzu/vm-operator/api/v1alpha1" ncpv1 "github.com/vmware-tanzu/vm-operator/external/ncp/api/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/util" @@ -64,13 +64,13 @@ func (np *nsxtNetworkProvider) verifyNSXTVirtualNetworkStatus(ctx *vmware.Cluste namespace := ctx.VSphereCluster.Namespace for _, condition := range vnet.Status.Conditions { if condition.Type == "Ready" && condition.Status != "True" { - conditions.MarkFalse(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition, infrav1.ClusterNetworkProvisionFailedReason, clusterv1.ConditionSeverityWarning, condition.Message) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition, vmwarev1.ClusterNetworkProvisionFailedReason, clusterv1.ConditionSeverityWarning, condition.Message) return errors.Errorf("virtual network ready status is: '%s' in cluster %s. reason: %s, message: %s", condition.Status, types.NamespacedName{Namespace: namespace, Name: clusterName}, condition.Reason, condition.Message) } } - conditions.MarkTrue(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition) + conditions.MarkTrue(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition) return nil } @@ -139,7 +139,7 @@ func (np *nsxtNetworkProvider) ProvisionClusterNetwork(ctx *vmware.ClusterContex return nil }) if err != nil { - conditions.MarkFalse(ctx.VSphereCluster, infrav1.ClusterNetworkReadyCondition, infrav1.ClusterNetworkProvisionFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.ClusterNetworkReadyCondition, vmwarev1.ClusterNetworkProvisionFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) ctx.Logger.V(2).Info("Failed to provision network", "cluster", clusterKey) return err } @@ -171,7 +171,7 @@ func (np *nsxtNetworkProvider) GetVMServiceAnnotations(ctx *vmware.ClusterContex } // ConfigureVirtualMachine configures a VirtualMachine object based on the networking configuration. -func (np *nsxtNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmopv1.VirtualMachine) error { +func (np *nsxtNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContext, vm *vmoprv1.VirtualMachine) error { nsxtClusterNetworkName := GetNSXTVirtualNetworkName(ctx.VSphereCluster.Name) for _, vnif := range vm.Spec.NetworkInterfaces { if vnif.NetworkType == NSXTTypeNetwork && vnif.NetworkName == nsxtClusterNetworkName { @@ -179,7 +179,7 @@ func (np *nsxtNetworkProvider) ConfigureVirtualMachine(ctx *vmware.ClusterContex return nil } } - vm.Spec.NetworkInterfaces = append(vm.Spec.NetworkInterfaces, vmopv1.VirtualMachineNetworkInterface{ + vm.Spec.NetworkInterfaces = append(vm.Spec.NetworkInterfaces, vmoprv1.VirtualMachineNetworkInterface{ NetworkName: nsxtClusterNetworkName, NetworkType: NSXTTypeNetwork, }) diff --git a/pkg/services/vmoperator/control_plane_endpoint.go b/pkg/services/vmoperator/control_plane_endpoint.go index 155a5d35cd..a7ea39eef5 100644 --- a/pkg/services/vmoperator/control_plane_endpoint.go +++ b/pkg/services/vmoperator/control_plane_endpoint.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ctrlutil "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services" ) @@ -67,7 +67,7 @@ func (s CPService) ReconcileControlPlaneEndpointService(ctx *vmware.ClusterConte if err != nil { if !apierrors.IsNotFound(err) { err = errors.Wrapf(err, "failed to check if VirtualMachineService exists") - conditions.MarkFalse(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition, infrav1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition, vmwarev1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) return nil, err } @@ -75,14 +75,14 @@ func (s CPService) ReconcileControlPlaneEndpointService(ctx *vmware.ClusterConte annotations, err := netProvider.GetVMServiceAnnotations(ctx) if err != nil { err = errors.Wrapf(err, "failed to get provider VirtualMachineService annotations") - conditions.MarkFalse(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition, infrav1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition, vmwarev1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) return nil, err } vmService, err = s.createVMControlPlaneService(ctx, annotations) if err != nil { err = errors.Wrapf(err, "failed to create VirtualMachineService") - conditions.MarkFalse(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition, infrav1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition, vmwarev1.LoadBalancerCreationFailedReason, clusterv1.ConditionSeverityWarning, err.Error()) return nil, err } } @@ -91,18 +91,18 @@ func (s CPService) ReconcileControlPlaneEndpointService(ctx *vmware.ClusterConte vip, err := getVMServiceVIP(vmService) if err != nil { err = errors.Wrapf(err, "VirtualMachineService LB does not yet have VIP assigned") - conditions.MarkFalse(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition, infrav1.WaitingForLoadBalancerIPReason, clusterv1.ConditionSeverityInfo, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition, vmwarev1.WaitingForLoadBalancerIPReason, clusterv1.ConditionSeverityInfo, err.Error()) return nil, err } cpEndpoint, err := getAPIEndpointFromVIP(vmService, vip) if err != nil { err = errors.Wrapf(err, "VirtualMachineService LB does not have an apiserver endpoint") - conditions.MarkFalse(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition, infrav1.WaitingForLoadBalancerIPReason, clusterv1.ConditionSeverityWarning, err.Error()) + conditions.MarkFalse(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition, vmwarev1.WaitingForLoadBalancerIPReason, clusterv1.ConditionSeverityWarning, err.Error()) return nil, err } - conditions.MarkTrue(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition) + conditions.MarkTrue(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition) return cpEndpoint, nil } diff --git a/pkg/services/vmoperator/control_plane_endpoint_test.go b/pkg/services/vmoperator/control_plane_endpoint_test.go index 3653b00e8c..d7689c4996 100644 --- a/pkg/services/vmoperator/control_plane_endpoint_test.go +++ b/pkg/services/vmoperator/control_plane_endpoint_test.go @@ -29,7 +29,7 @@ import ( clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/services/network" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/util" @@ -100,7 +100,7 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { expectedConditions clusterv1.Conditions cluster *clusterv1.Cluster - vsphereCluster *infrav1.VSphereCluster + vsphereCluster *vmwarev1.VSphereCluster ctx *vmware.ClusterContext apiEndpoint *clusterv1.APIEndpoint @@ -167,7 +167,7 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { expectAPIEndpoint = false expectVMS = false apiEndpoint, err = cpService.ReconcileControlPlaneEndpointService(ctx, network.DummyNetworkProvider()) - Expect(conditions.Get(ctx.VSphereCluster, infrav1.LoadBalancerReadyCondition)).To(BeNil()) + Expect(conditions.Get(ctx.VSphereCluster, vmwarev1.LoadBalancerReadyCondition)).To(BeNil()) verifyOutput() }) @@ -193,9 +193,9 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { netOpProvider := network.NetOpNetworkProvider(ctx.Client) // we expect the reconciliation fail because lack of bootstrap data expectedConditions = append(expectedConditions, clusterv1.Condition{ - Type: infrav1.LoadBalancerReadyCondition, + Type: vmwarev1.LoadBalancerReadyCondition, Status: corev1.ConditionFalse, - Reason: infrav1.LoadBalancerCreationFailedReason, + Reason: vmwarev1.LoadBalancerCreationFailedReason, Message: noNetworkFailure, }) apiEndpoint, err = cpService.ReconcileControlPlaneEndpointService(ctx, netOpProvider) @@ -207,7 +207,7 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { expectedAnnotations["netoperator.vmware.com/network-name"] = "dummy-network" expectVMS = true createDefaultNetwork(ctx) - expectedConditions[0].Reason = infrav1.WaitingForLoadBalancerIPReason + expectedConditions[0].Reason = vmwarev1.WaitingForLoadBalancerIPReason expectedConditions[0].Message = waitingForVIPFailure apiEndpoint, err = cpService.ReconcileControlPlaneEndpointService(ctx, netOpProvider) verifyOutput() @@ -235,9 +235,9 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { expectVMS = false expectedType = vmoprv1.VirtualMachineServiceTypeLoadBalancer expectedConditions = append(expectedConditions, clusterv1.Condition{ - Type: infrav1.LoadBalancerReadyCondition, + Type: vmwarev1.LoadBalancerReadyCondition, Status: corev1.ConditionFalse, - Reason: infrav1.LoadBalancerCreationFailedReason, + Reason: vmwarev1.LoadBalancerCreationFailedReason, Message: noNetworkFailure, }) @@ -253,7 +253,7 @@ var _ = Describe("ControlPlaneEndpoint Tests", func() { expectedVnetName := network.GetNSXTVirtualNetworkName(clusterName) expectedAnnotations["ncp.vmware.com/virtual-network-name"] = expectedVnetName expectVMS = true - expectedConditions[0].Reason = infrav1.WaitingForLoadBalancerIPReason + expectedConditions[0].Reason = vmwarev1.WaitingForLoadBalancerIPReason expectedConditions[0].Message = waitingForVIPFailure createVnet(ctx) apiEndpoint, err = cpService.ReconcileControlPlaneEndpointService(ctx, nsxtProvider) diff --git a/pkg/session/session_test.go b/pkg/session/session_test.go index 370ca3bc73..028e530803 100644 --- a/pkg/session/session_test.go +++ b/pkg/session/session_test.go @@ -30,7 +30,7 @@ import ( "k8s.io/klog/v2" ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/test/helpers/vcsim" ) @@ -86,7 +86,7 @@ func TestGetSession(t *testing.T) { func sessionCount(stdout io.Reader) (int, error) { buf := make([]byte, 1024) count := 0 - lineSep := []byte(v1beta1.GroupVersion.String()) + lineSep := []byte(infrav1.GroupVersion.String()) for { c, err := stdout.Read(buf) diff --git a/pkg/util/cluster.go b/pkg/util/cluster.go index bd4303e21c..eb71aa1801 100644 --- a/pkg/util/cluster.go +++ b/pkg/util/cluster.go @@ -25,12 +25,12 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" ) // GetVSphereClusterFromVMwareMachine gets the vmware.infrastructure.cluster.x-k8s.io.VSphereCluster resource for the given VSphereMachine. // TODO (srm09): Rename this to a more appropriate name. -func GetVSphereClusterFromVMwareMachine(ctx context.Context, c client.Client, machine *vmwarev1b1.VSphereMachine) (*vmwarev1b1.VSphereCluster, error) { +func GetVSphereClusterFromVMwareMachine(ctx context.Context, c client.Client, machine *vmwarev1.VSphereMachine) (*vmwarev1.VSphereCluster, error) { clusterName := machine.Labels[clusterv1.ClusterNameLabel] if clusterName == "" { return nil, errors.Errorf("error getting VSphereCluster name from VSphereMachine %s/%s", @@ -49,7 +49,7 @@ func GetVSphereClusterFromVMwareMachine(ctx context.Context, c client.Client, ma Namespace: machine.Namespace, Name: cluster.Spec.InfrastructureRef.Name, } - vsphereCluster := &vmwarev1b1.VSphereCluster{} + vsphereCluster := &vmwarev1.VSphereCluster{} err := c.Get(ctx, vsphereClusterKey, vsphereCluster) return vsphereCluster, err } diff --git a/pkg/util/machines.go b/pkg/util/machines.go index 38e5fbce90..562c3b164b 100644 --- a/pkg/util/machines.go +++ b/pkg/util/machines.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" - vmwarev1b1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" ) // GetVSphereMachinesInCluster gets a cluster's VSphereMachine resources. @@ -63,8 +63,8 @@ func GetVSphereMachinesInCluster( func GetVSphereMachine( ctx context.Context, controllerClient client.Client, - namespace, machineName string) (*vmwarev1b1.VSphereMachine, error) { - machine := &vmwarev1b1.VSphereMachine{} + namespace, machineName string) (*vmwarev1.VSphereMachine, error) { + machine := &vmwarev1.VSphereMachine{} namespacedName := apitypes.NamespacedName{ Namespace: namespace, Name: machineName, diff --git a/pkg/util/networkutil.go b/pkg/util/networkutil.go index 32e041be24..dae51daceb 100644 --- a/pkg/util/networkutil.go +++ b/pkg/util/networkutil.go @@ -21,7 +21,7 @@ import ( "github.com/blang/semver/v4" "github.com/pkg/errors" - v1 "k8s.io/api/core/v1" + corev1 "k8s.io/api/core/v1" apitypes "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" ) @@ -47,7 +47,7 @@ var ( // GetNamespaceNetSnatIP finds out the namespace's corresponding network's SNAT IP. func GetNamespaceNetSnatIP(ctx context.Context, controllerClient client.Client, namespace string) (string, error) { - namespaceObj := &v1.Namespace{} + namespaceObj := &corev1.Namespace{} namespacedName := apitypes.NamespacedName{ Name: namespace, } @@ -71,7 +71,7 @@ func GetNamespaceNetSnatIP(ctx context.Context, controllerClient client.Client, // GetNCPVersion finds out the running ncp's version from its configmap. func GetNCPVersion(ctx context.Context, controllerClient client.Client) (string, error) { - configmapObj := &v1.ConfigMap{} + configmapObj := &corev1.ConfigMap{} namespacedName := apitypes.NamespacedName{ Name: NCPVersionConfigMap, Namespace: NCPNamespace, diff --git a/pkg/util/testutil.go b/pkg/util/testutil.go index ab3a298ad7..fd9d4b42a4 100644 --- a/pkg/util/testutil.go +++ b/pkg/util/testutil.go @@ -32,7 +32,7 @@ import ( bootstrapv1 "sigs.k8s.io/cluster-api/bootstrap/kubeadm/api/v1beta1" testclient "sigs.k8s.io/controller-runtime/pkg/client/fake" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context" "sigs.k8s.io/cluster-api-provider-vsphere/pkg/context/vmware" ) @@ -56,7 +56,7 @@ func CreateCluster(clusterName string) *clusterv1.Cluster { }, Spec: clusterv1.ClusterSpec{ InfrastructureRef: &corev1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraClusterKind, Name: clusterName, }, @@ -64,10 +64,10 @@ func CreateCluster(clusterName string) *clusterv1.Cluster { } } -func CreateVSphereCluster(clusterName string) *infrav1.VSphereCluster { - return &infrav1.VSphereCluster{ +func CreateVSphereCluster(clusterName string) *vmwarev1.VSphereCluster { + return &vmwarev1.VSphereCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraClusterKind, }, ObjectMeta: metav1.ObjectMeta{ @@ -97,7 +97,7 @@ func CreateMachine(machineName, clusterName, k8sVersion string, controlPlaneLabe }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraMachineKind, Name: machineName, }, @@ -111,10 +111,10 @@ func CreateMachine(machineName, clusterName, k8sVersion string, controlPlaneLabe return machine } -func CreateVSphereMachine(machineName, clusterName, className, imageName, storageClass string, controlPlaneLabel bool) *infrav1.VSphereMachine { - vsphereMachine := &infrav1.VSphereMachine{ +func CreateVSphereMachine(machineName, clusterName, className, imageName, storageClass string, controlPlaneLabel bool) *vmwarev1.VSphereMachine { + vsphereMachine := &vmwarev1.VSphereMachine{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: infraMachineKind, }, ObjectMeta: metav1.ObjectMeta{ @@ -123,7 +123,7 @@ func CreateVSphereMachine(machineName, clusterName, className, imageName, storag clusterv1.ClusterNameLabel: clusterName, }, }, - Spec: infrav1.VSphereMachineSpec{ + Spec: vmwarev1.VSphereMachineSpec{ ClassName: className, ImageName: imageName, StorageClass: storageClass, @@ -140,7 +140,7 @@ func CreateVSphereMachine(machineName, clusterName, className, imageName, storag func createScheme() *runtime.Scheme { scheme := runtime.NewScheme() _ = clientgoscheme.AddToScheme(scheme) - _ = infrav1.AddToScheme(scheme) + _ = vmwarev1.AddToScheme(scheme) _ = clusterv1.AddToScheme(scheme) _ = topologyv1.AddToScheme(scheme) _ = vmoprv1.AddToScheme(scheme) @@ -149,7 +149,7 @@ func createScheme() *runtime.Scheme { return scheme } -func CreateClusterContext(cluster *clusterv1.Cluster, vsphereCluster *infrav1.VSphereCluster) *vmware.ClusterContext { +func CreateClusterContext(cluster *clusterv1.Cluster, vsphereCluster *vmwarev1.VSphereCluster) *vmware.ClusterContext { scheme := createScheme() controllerManagerContext := &context.ControllerManagerContext{ Context: goctx.Background(), @@ -177,7 +177,7 @@ func CreateClusterContext(cluster *clusterv1.Cluster, vsphereCluster *infrav1.VS } func CreateMachineContext(clusterContext *vmware.ClusterContext, machine *clusterv1.Machine, - vsphereMachine *infrav1.VSphereMachine) *vmware.SupervisorMachineContext { + vsphereMachine *vmwarev1.VSphereMachine) *vmware.SupervisorMachineContext { // Build the machine context. return &vmware.SupervisorMachineContext{ BaseMachineContext: &context.BaseMachineContext{ diff --git a/test/e2e/dhcp_overrides_test.go b/test/e2e/dhcp_overrides_test.go index f1f11fb352..3b1d569e68 100644 --- a/test/e2e/dhcp_overrides_test.go +++ b/test/e2e/dhcp_overrides_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" - types "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" ) type GuestInfoMetadata struct { @@ -101,7 +101,7 @@ var _ = Describe("DHCPOverrides configuration test", func() { }) }) -func getVMMetadata(vm types.VSphereVM) ([]byte, error) { +func getVMMetadata(vm infrav1.VSphereVM) ([]byte, error) { vmObj, err := vsphereFinder.VirtualMachine(ctx, vm.Name) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index 3e4ead0e8c..c901ec889d 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -35,7 +35,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/ginkgoextensions" capiutil "sigs.k8s.io/cluster-api/util" - "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" + infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/test/helpers" ) @@ -171,7 +171,7 @@ var _ = SynchronizedAfterSuite(func() { func initScheme() *runtime.Scheme { sc := runtime.NewScheme() framework.TryAddDefaultSchemes(sc) - _ = v1beta1.AddToScheme(sc) + _ = infrav1.AddToScheme(sc) return sc } diff --git a/test/e2e/gpu_pci_passthrough_test.go b/test/e2e/gpu_pci_passthrough_test.go index 9166322fe5..7cddf7aaf4 100644 --- a/test/e2e/gpu_pci_passthrough_test.go +++ b/test/e2e/gpu_pci_passthrough_test.go @@ -26,7 +26,7 @@ import ( "github.com/vmware/govmomi/vim25/types" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/clusterctl" capiutil "sigs.k8s.io/cluster-api/util" ) @@ -75,7 +75,7 @@ var _ = Describe("Cluster creation with GPU devices as PCI passthrough [speciali func verifyPCIDeviceOnWorkerNodes(clusterName, namespace string) { list := getVSphereVMsForCluster(clusterName, namespace) for _, vm := range list.Items { - if _, ok := vm.GetLabels()[v1beta1.MachineControlPlaneLabel]; !ok { + if _, ok := vm.GetLabels()[clusterv1.MachineControlPlaneLabel]; !ok { finder := find.NewFinder(vsphereClient.Client, false) dc, err := finder.Datacenter(ctx, vm.Spec.Datacenter) Expect(err).NotTo(HaveOccurred()) diff --git a/test/e2e/storage_policy_test.go b/test/e2e/storage_policy_test.go index 8d09f83c2d..dc697d1957 100644 --- a/test/e2e/storage_policy_test.go +++ b/test/e2e/storage_policy_test.go @@ -27,7 +27,7 @@ import ( "github.com/vmware/govmomi/pbm/types" corev1 "k8s.io/api/core/v1" "k8s.io/utils/pointer" - "sigs.k8s.io/cluster-api/api/v1beta1" + clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/test/framework/clusterctl" "sigs.k8s.io/cluster-api/util" "sigs.k8s.io/controller-runtime/pkg/client" @@ -146,7 +146,7 @@ func getVSphereVMsForCluster(clusterName, namespace string) *infrav1.VSphereVMLi &vms, client.InNamespace(namespace), client.MatchingLabels{ - v1beta1.ClusterNameLabel: clusterName, + clusterv1.ClusterNameLabel: clusterName, }, ) Expect(err).NotTo(HaveOccurred()) diff --git a/test/integration/integration_suite_test.go b/test/integration/integration_suite_test.go index 7a3ab99a58..5aff98d883 100644 --- a/test/integration/integration_suite_test.go +++ b/test/integration/integration_suite_test.go @@ -47,7 +47,7 @@ import ( "sigs.k8s.io/cluster-api/test/framework/clusterctl" ctrl "sigs.k8s.io/controller-runtime" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" "sigs.k8s.io/cluster-api-provider-vsphere/test/helpers" ) @@ -86,8 +86,8 @@ var ( } vsphereclustersResource = schema.GroupVersionResource{ - Group: infrav1.GroupVersion.Group, - Version: infrav1.GroupVersion.Version, + Group: vmwarev1.GroupVersion.Group, + Version: vmwarev1.GroupVersion.Version, Resource: "vsphereclusters", } @@ -104,14 +104,14 @@ var ( } vspheremachinesResource = schema.GroupVersionResource{ - Group: infrav1.GroupVersion.Group, - Version: infrav1.GroupVersion.Version, + Group: vmwarev1.GroupVersion.Group, + Version: vmwarev1.GroupVersion.Version, Resource: "vspheremachines", } vspheremachinetemplateResource = schema.GroupVersionResource{ - Group: infrav1.GroupVersion.Group, - Version: infrav1.GroupVersion.Version, + Group: vmwarev1.GroupVersion.Group, + Version: vmwarev1.GroupVersion.Version, Resource: "vspheremachinetemplates", } @@ -157,14 +157,14 @@ type Manifests struct { type ClusterComponents struct { Cluster *clusterv1.Cluster - VSphereCluster *infrav1.VSphereCluster + VSphereCluster *vmwarev1.VSphereCluster } // ControlPlaneComponents contains the resources required to create a control // plane machine. type ControlPlaneComponents struct { Machine *clusterv1.Machine - VSphereMachine *infrav1.VSphereMachine + VSphereMachine *vmwarev1.VSphereMachine KubeadmConfig *bootstrapv1.KubeadmConfig } @@ -172,7 +172,7 @@ type ControlPlaneComponents struct { // MachineDeployment. type WorkerComponents struct { MachineDeployment *clusterv1.MachineDeployment - VSphereMachineTemplate *infrav1.VSphereMachineTemplate + VSphereMachineTemplate *vmwarev1.VSphereMachineTemplate KubeadmConfigTemplate *bootstrapv1.KubeadmConfigTemplate } @@ -290,7 +290,7 @@ var _ = SynchronizedAfterSuite(func() { func initScheme() *runtime.Scheme { sc := runtime.NewScheme() framework.TryAddDefaultSchemes(sc) - _ = infrav1.AddToScheme(sc) + _ = vmwarev1.AddToScheme(sc) return sc } @@ -363,9 +363,9 @@ func generateManifests(testNamespace string) *Manifests { func createClusterComponents(testNamespace string) *ClusterComponents { By("Creating a VSphereCluster") - vsphereCluster := infrav1.VSphereCluster{ + vsphereCluster := vmwarev1.VSphereCluster{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereCluster", }, ObjectMeta: metav1.ObjectMeta{ @@ -395,7 +395,7 @@ func createClusterComponents(testNamespace string) *ClusterComponents { ServiceDomain: "cluster.local", }, InfrastructureRef: &corev1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereCluster", Name: vsphereCluster.Name, Namespace: vsphereCluster.Namespace, @@ -417,9 +417,9 @@ func createControlPlaneComponentsList(testNamespace string) []*ControlPlaneCompo var controlPlaneComponents ControlPlaneComponents By("Creating a VSphereMachine") - vsphereMachine := infrav1.VSphereMachine{ + vsphereMachine := vmwarev1.VSphereMachine{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereMachine", }, ObjectMeta: metav1.ObjectMeta{ @@ -430,7 +430,7 @@ func createControlPlaneComponentsList(testNamespace string) []*ControlPlaneCompo clusterv1.ClusterNameLabel: testClusterName, }, }, - Spec: infrav1.VSphereMachineSpec{ + Spec: vmwarev1.VSphereMachineSpec{ ImageName: dummyVirtualMachineImageName, ClassName: controlPlaneMachineClassName, StorageClass: controlPlaneMachineStorageClass, @@ -485,7 +485,7 @@ func createControlPlaneComponentsList(testNamespace string) []*ControlPlaneCompo }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereMachine", Name: vsphereMachine.Name, Namespace: vsphereMachine.Namespace, @@ -506,9 +506,9 @@ func createWorkerComponents(testNamespace string) *WorkerComponents { workerMachineDeploymentNameFmt := "%s-workers-0" By("Creating VSphereMachineTemplates") - vsphereMachineTemplate := infrav1.VSphereMachineTemplate{ + vsphereMachineTemplate := vmwarev1.VSphereMachineTemplate{ TypeMeta: metav1.TypeMeta{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereMachineTemplate", }, ObjectMeta: metav1.ObjectMeta{ @@ -575,7 +575,7 @@ func createWorkerComponents(testNamespace string) *WorkerComponents { }, }, InfrastructureRef: corev1.ObjectReference{ - APIVersion: infrav1.GroupVersion.String(), + APIVersion: vmwarev1.GroupVersion.String(), Kind: "VSphereMachineTemplate", Name: vsphereMachineTemplate.Name, Namespace: vsphereMachineTemplate.Namespace, @@ -718,7 +718,7 @@ func assertVirtualMachineState(machine *clusterv1.Machine, vm *vmoprv1.VirtualMa // receives a control plane endpoint that matches the expected IP address. func assertClusterEventuallyGetsControlPlaneEndpoint(clusterName, clusterNs string, ipAddress string) { EventuallyWithOffset(1, func() bool { - vsphereCluster := &infrav1.VSphereCluster{} + vsphereCluster := &vmwarev1.VSphereCluster{} getResource(vsphereclustersResource, clusterName, clusterNs, vsphereCluster) // If the control plane endpoint is undefined, return false if vsphereCluster.Spec.ControlPlaneEndpoint.IsZero() { @@ -771,7 +771,7 @@ func toOwnerRef(obj canBeReferenced) *metav1.OwnerReference { } func setIPAddressOnMachine(machineName, machineNs, ipAddress string) { - vsphereMachine := &infrav1.VSphereMachine{} + vsphereMachine := &vmwarev1.VSphereMachine{} getResource(vspheremachinesResource, machineName, machineNs, vsphereMachine) vsphereMachine.Status.IPAddr = ipAddress updateResourceStatus(vspheremachinesResource, vsphereMachine) diff --git a/test/integration/sanity_test.go b/test/integration/sanity_test.go index a377143439..4ba7a97626 100644 --- a/test/integration/sanity_test.go +++ b/test/integration/sanity_test.go @@ -28,7 +28,7 @@ import ( "k8s.io/utils/pointer" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" - infrav1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" + vmwarev1 "sigs.k8s.io/cluster-api-provider-vsphere/apis/vmware/v1beta1" ) // The purpose of this test is to start up a CAPI controller against a real API @@ -132,7 +132,7 @@ var _ = Describe("Sanity tests", func() { getResource(machinesResource, controlPlane.Machine.Name, controlPlane.Machine.Namespace, machine) // GET the associated VSphereMachine. - vsphereMachine := &infrav1.VSphereMachine{} + vsphereMachine := &vmwarev1.VSphereMachine{} getResource(vspheremachinesResource, controlPlane.Machine.Name, controlPlane.Machine.Namespace, vsphereMachine) // ASSERT the VirtualMachine and bootstrap data ConfigMap resources