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

Commit

Permalink
Provide BareMetalMachineProviderSpec with the right fields
Browse files Browse the repository at this point in the history
kni-install will create the master Machines and worker MachineSet
with the baremetal machine providerSpec. cluster-api-provider-baremetal
expects two fields: the image and userdata (checksum URL).
After this change the cluster-api-provider baremetal can now start
using this image provided via the BareMetalMachineProviderSpec instead
of a hard-coded one.
  • Loading branch information
sadasu committed May 30, 2019
1 parent e5b39b1 commit 43a9448
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/asset/machines/baremetal/machines.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
machineapi "github.com/openshift/cluster-api/pkg/apis/machine/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
corev1 "k8s.io/api/core/v1"

"github.com/openshift-metalkube/kni-installer/pkg/types"
"github.com/openshift-metalkube/kni-installer/pkg/types/baremetal"
Expand Down Expand Up @@ -60,5 +61,11 @@ func Machines(clusterID string, config *types.InstallConfig, pool *types.Machine
}

func provider(clusterName string, networkInterfaceAddress string, platform *baremetal.Platform, userDataSecret string) *baremetalprovider.BareMetalMachineProviderSpec {
return &baremetalprovider.BareMetalMachineProviderSpec{}
return &baremetalprovider.BareMetalMachineProviderSpec{
Image: baremetalprovider.Image{
URL: platform.MasterConfiguration["image_source"].(string),
Checksum: platform.MasterConfiguration["image_checksum"].(string),
},
UserData: &corev1.SecretReference{Name: userDataSecret},
}
}

0 comments on commit 43a9448

Please sign in to comment.