Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openstack: Fix nil HostManager in openstackContext #610

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/platforms/openstack/openstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions pkg/platforms/platforms.go
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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,
Expand Down
Loading