From b144b97f70764faa33677edf58d0319181f9d419 Mon Sep 17 00:00:00 2001 From: Sandhya Dasu Date: Tue, 21 May 2019 13:41:10 -0400 Subject: [PATCH] Baremetal: Use BareMetalMachineProviderSpec The ProviderSpec field for Machines was using the libvirt providerspec. Now that we have defined a type for baremetal, use the baremetal providerspec type instead. A future commit will place contents into fields of the baremetal machine providerspec. --- pkg/asset/machines/baremetal/machines.go | 8 +++----- pkg/asset/machines/master.go | 4 ++++ pkg/asset/machines/worker.go | 4 ++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/asset/machines/baremetal/machines.go b/pkg/asset/machines/baremetal/machines.go index df0dffdb3..be26efb51 100644 --- a/pkg/asset/machines/baremetal/machines.go +++ b/pkg/asset/machines/baremetal/machines.go @@ -4,8 +4,7 @@ package baremetal import ( "fmt" - // FIXME: baremetal - libvirtprovider "github.com/openshift/cluster-api-provider-libvirt/pkg/apis/libvirtproviderconfig/v1alpha1" + baremetalprovider "github.com/metal3-io/cluster-api-provider-baremetal/pkg/apis/baremetal/v1alpha1" machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -60,7 +59,6 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine return machines, nil } -func provider(clusterName string, networkInterfaceAddress string, platform *baremetal.Platform, userDataSecret string) *libvirtprovider.LibvirtMachineProviderConfig { - // FIXME: baremetal - return &libvirtprovider.LibvirtMachineProviderConfig{} +func provider(clusterName string, networkInterfaceAddress string, platform *baremetal.Platform, userDataSecret string) *baremetalprovider.BareMetalMachineProviderSpec { + return &baremetalprovider.BareMetalMachineProviderSpec{} } diff --git a/pkg/asset/machines/master.go b/pkg/asset/machines/master.go index 6f2b69148..689f602f7 100644 --- a/pkg/asset/machines/master.go +++ b/pkg/asset/machines/master.go @@ -19,6 +19,8 @@ import ( azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1alpha1" openstackapi "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis" openstackprovider "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1" + baremetalapi "github.com/metal3-io/cluster-api-provider-baremetal/pkg/apis" + baremetalprovider "github.com/metal3-io/cluster-api-provider-baremetal/pkg/apis/baremetal/v1alpha1" "github.com/openshift-metalkube/kni-installer/pkg/asset" "github.com/openshift-metalkube/kni-installer/pkg/asset/ignition/machine" @@ -254,11 +256,13 @@ func (m *Master) Machines() ([]machineapi.Machine, error) { azureapi.AddToScheme(scheme) libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) + baremetalapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( awsprovider.SchemeGroupVersion, azureprovider.SchemeGroupVersion, libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, + baremetalprovider.SchemeGroupVersion, ) machines := []machineapi.Machine{} diff --git a/pkg/asset/machines/worker.go b/pkg/asset/machines/worker.go index ce2ff68f1..077fa65aa 100644 --- a/pkg/asset/machines/worker.go +++ b/pkg/asset/machines/worker.go @@ -19,6 +19,8 @@ import ( azureprovider "sigs.k8s.io/cluster-api-provider-azure/pkg/apis/azureprovider/v1alpha1" openstackapi "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis" openstackprovider "sigs.k8s.io/cluster-api-provider-openstack/pkg/apis/openstackproviderconfig/v1alpha1" + baremetalapi "github.com/metal3-io/cluster-api-provider-baremetal/pkg/apis" + baremetalprovider "github.com/metal3-io/cluster-api-provider-baremetal/pkg/apis/baremetal/v1alpha1" "github.com/openshift-metalkube/kni-installer/pkg/asset" "github.com/openshift-metalkube/kni-installer/pkg/asset/ignition/machine" @@ -288,11 +290,13 @@ func (w *Worker) MachineSets() ([]machineapi.MachineSet, error) { libvirtapi.AddToScheme(scheme) openstackapi.AddToScheme(scheme) azureapi.AddToScheme(scheme) + baremetalapi.AddToScheme(scheme) decoder := serializer.NewCodecFactory(scheme).UniversalDecoder( awsprovider.SchemeGroupVersion, libvirtprovider.SchemeGroupVersion, openstackprovider.SchemeGroupVersion, azureprovider.SchemeGroupVersion, + baremetalprovider.SchemeGroupVersion, ) machineSets := []machineapi.MachineSet{}