diff --git a/pkg/asset/cluster/tfvars.go b/pkg/asset/cluster/tfvars.go index 4159323a6a0..9edd9afb7ec 100644 --- a/pkg/asset/cluster/tfvars.go +++ b/pkg/asset/cluster/tfvars.go @@ -15,13 +15,13 @@ import ( ibmcloudprovider "github.com/openshift/cluster-api-provider-ibmcloud/pkg/apis/ibmcloudprovider/v1beta1" libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" "github.com/pkg/errors" "github.com/sirupsen/logrus" awsprovider "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsprovider/v1beta1" azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1beta1" configv1 "github.com/openshift/api/config/v1" + machinev1 "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/asset" "github.com/openshift/installer/pkg/asset/ignition" "github.com/openshift/installer/pkg/asset/ignition/bootstrap" @@ -612,9 +612,9 @@ func (t *TerraformVariables) Generate(parents asset.Parents) error { if err != nil { return err } - controlPlaneConfigs := make([]*vsphereprovider.VSphereMachineProviderSpec, len(controlPlanes)) + controlPlaneConfigs := make([]*machinev1.VSphereMachineProviderSpec, len(controlPlanes)) for i, c := range controlPlanes { - controlPlaneConfigs[i] = c.Spec.ProviderSpec.Value.Object.(*vsphereprovider.VSphereMachineProviderSpec) + controlPlaneConfigs[i] = c.Spec.ProviderSpec.Value.Object.(*machinev1.VSphereMachineProviderSpec) } // Set this flag to use an existing folder specified in the install-config. Otherwise, create one. diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 60211338c1d..b05fe64c2c1 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -21,8 +21,6 @@ import ( libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - vsphereapi "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider" - vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -544,7 +542,11 @@ func (m *Master) Machines() ([]machineapi.Machine, error) { libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) - vsphereapi.AddToScheme(scheme) + // Add vsphere types to scheme + scheme.AddKnownTypes(machineapi.SchemeGroupVersion, + &machineapi.VSphereMachineProviderSpec{}, + ) + machineapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( alibabacloudprovider.SchemeGroupVersion, awsprovider.SchemeGroupVersion, @@ -554,7 +556,7 @@ func (m *Master) Machines() ([]machineapi.Machine, error) { ibmcloudprovider.SchemeGroupVersion, libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, - vsphereprovider.SchemeGroupVersion, + machineapi.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, ) diff --git a/pkg/asset/machines/vsphere/machines.go b/pkg/asset/machines/vsphere/machines.go index aeea37ec4ca..7cce161bd12 100644 --- a/pkg/asset/machines/vsphere/machines.go +++ b/pkg/asset/machines/vsphere/machines.go @@ -5,7 +5,6 @@ import ( "fmt" machineapi "github.com/openshift/api/machine/v1beta1" - vsphereapis "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -63,7 +62,7 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine return machines, nil } -func provider(clusterID string, platform *vsphere.Platform, mpool *vsphere.MachinePool, osImage string, userDataSecret string) (*vsphereapis.VSphereMachineProviderSpec, error) { +func provider(clusterID string, platform *vsphere.Platform, mpool *vsphere.MachinePool, osImage string, userDataSecret string) (*machineapi.VSphereMachineProviderSpec, error) { folder := fmt.Sprintf("/%s/vm/%s", platform.Datacenter, clusterID) resourcePool := fmt.Sprintf("/%s/host/%s/Resources", platform.Datacenter, platform.Cluster) if platform.Folder != "" { @@ -73,22 +72,22 @@ func provider(clusterID string, platform *vsphere.Platform, mpool *vsphere.Machi resourcePool = platform.ResourcePool } - return &vsphereapis.VSphereMachineProviderSpec{ + return &machineapi.VSphereMachineProviderSpec{ TypeMeta: metav1.TypeMeta{ - APIVersion: vsphereapis.SchemeGroupVersion.String(), + APIVersion: machineapi.SchemeGroupVersion.String(), Kind: "VSphereMachineProviderSpec", }, UserDataSecret: &corev1.LocalObjectReference{Name: userDataSecret}, CredentialsSecret: &corev1.LocalObjectReference{Name: "vsphere-cloud-credentials"}, Template: osImage, - Network: vsphereapis.NetworkSpec{ - Devices: []vsphereapis.NetworkDeviceSpec{ + Network: machineapi.NetworkSpec{ + Devices: []machineapi.NetworkDeviceSpec{ { NetworkName: platform.Network, }, }, }, - Workspace: &vsphereapis.Workspace{ + Workspace: &machineapi.Workspace{ Server: platform.VCenter, Datacenter: platform.Datacenter, Datastore: platform.DefaultDatastore, diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index 01fc88f8794..614e8976b37 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -21,8 +21,6 @@ import ( libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1beta1" ovirtproviderapi "github.com/openshift/cluster-api-provider-ovirt/pkg/apis" ovirtprovider "github.com/openshift/cluster-api-provider-ovirt/pkg/apis/ovirtprovider/v1beta1" - vsphereproviderapi "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider" - vsphereprovider "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" mcfgv1 "github.com/openshift/machine-config-operator/pkg/apis/machineconfiguration.openshift.io/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -547,7 +545,11 @@ func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) ovirtproviderapi.AddToScheme(scheme) - vsphereproviderapi.AddToScheme(scheme) + // Add vsphere types to scheme + scheme.AddKnownTypes(machineapi.SchemeGroupVersion, + &machineapi.VSphereMachineProviderSpec{}, + ) + machineapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( alibabacloudprovider.SchemeGroupVersion, awsprovider.SchemeGroupVersion, @@ -558,7 +560,7 @@ func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, ovirtprovider.SchemeGroupVersion, - vsphereprovider.SchemeGroupVersion, + machineapi.SchemeGroupVersion, ) machineSets := []machineapi.MachineSet{} diff --git a/pkg/tfvars/vsphere/vsphere.go b/pkg/tfvars/vsphere/vsphere.go index f1620c2f08d..5deaf217813 100644 --- a/pkg/tfvars/vsphere/vsphere.go +++ b/pkg/tfvars/vsphere/vsphere.go @@ -4,9 +4,9 @@ import ( "encoding/json" "strings" - vsphereapis "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" "github.com/pkg/errors" + machineapi "github.com/openshift/api/machine/v1beta1" "github.com/openshift/installer/pkg/tfvars/internal/cache" "github.com/openshift/installer/pkg/types/vsphere" ) @@ -33,7 +33,7 @@ type config struct { // TFVarsSources contains the parameters to be converted into Terraform variables type TFVarsSources struct { - ControlPlaneConfigs []*vsphereapis.VSphereMachineProviderSpec + ControlPlaneConfigs []*machineapi.VSphereMachineProviderSpec Username string Password string Cluster string diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/addtoscheme_vsphereprovider_v1beta1.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/addtoscheme_vsphereprovider_v1beta1.go deleted file mode 100644 index 088adfa1aac..00000000000 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/addtoscheme_vsphereprovider_v1beta1.go +++ /dev/null @@ -1,10 +0,0 @@ -package apis - -import ( - "github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1" -) - -func init() { - // Register the types with the Scheme so the components can map objects to GroupVersionKinds and back - AddToSchemes = append(AddToSchemes, v1beta1.SchemeBuilder.AddToScheme) -} diff --git a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go b/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go deleted file mode 100644 index 3b340c70b7b..00000000000 --- a/vendor/github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/apis.go +++ /dev/null @@ -1,19 +0,0 @@ -// Generate deepcopy for apis -//go:generate go run ../../../vendor/sigs.k8s.io/controller-tools/cmd/controller-gen paths=./... object:headerFile=../../../hack/boilerplate.go.txt,year=2019 -// Ensure generated code is goimports compliant -//go:generate goimports -w ./v1beta1/zz_generated.deepcopy.go - -// Package apis contains Kubernetes API groups. -package apis - -import ( - "k8s.io/apimachinery/pkg/runtime" -) - -// AddToSchemes may be used to add all resources defined in the project to a Scheme -var AddToSchemes runtime.SchemeBuilder - -// AddToScheme adds all Resources to the Scheme -func AddToScheme(s *runtime.Scheme) error { - return AddToSchemes.AddToScheme(s) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index c3e192a1b67..f1240894a68 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1560,7 +1560,6 @@ github.com/openshift/library-go/pkg/route/routeapihelpers ## explicit github.com/openshift/machine-api-operator/pkg/apis/machine github.com/openshift/machine-api-operator/pkg/apis/machine/v1beta1 -github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider github.com/openshift/machine-api-operator/pkg/apis/vsphereprovider/v1beta1 # github.com/openshift/machine-config-operator v0.0.0 => github.com/openshift/machine-config-operator v0.0.1-0.20201009041932-4fe8559913b8 ## explicit