Skip to content
This repository has been archived by the owner on Jul 23, 2019. It is now read-only.

Commit

Permalink
Baremetal: Use BareMetalMachineProviderSpec
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sadasu committed May 22, 2019
1 parent c2410a1 commit b144b97
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pkg/asset/machines/baremetal/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}
}
4 changes: 4 additions & 0 deletions pkg/asset/machines/master.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}
Expand Down
4 changes: 4 additions & 0 deletions pkg/asset/machines/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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{}
Expand Down

0 comments on commit b144b97

Please sign in to comment.