diff --git a/pkg/platforms/openstack/openstack.go b/pkg/platforms/openstack/openstack.go index b86e079ca..cc975dbe5 100644 --- a/pkg/platforms/openstack/openstack.go +++ b/pkg/platforms/openstack/openstack.go @@ -102,8 +102,10 @@ type OSPDeviceInfo struct { NetworkID string } -func New() OpenstackInterface { - return &openstackContext{} +func New(hostManager host.HostManagerInterface) OpenstackInterface { + return &openstackContext{ + hostManager: hostManager, + } } // GetOpenstackData gets the metadata and network_data diff --git a/pkg/platforms/platforms.go b/pkg/platforms/platforms.go index 529f51821..19c74cef3 100644 --- a/pkg/platforms/platforms.go +++ b/pkg/platforms/platforms.go @@ -1,8 +1,10 @@ package platforms import ( + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/host" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/platforms/openshift" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/platforms/openstack" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" ) //go:generate ../../bin/mockgen -destination mock/mock_platforms.go -source platforms.go @@ -21,8 +23,9 @@ func NewDefaultPlatformHelper() (Interface, error) { if err != nil { return nil, err } - - openstackContext := openstack.New() + utilsHelper := utils.New() + hostManager := host.NewHostManager(utilsHelper) + openstackContext := openstack.New(hostManager) return &platformHelper{ openshiftContext,