From 58e0d3c4928156d2a52aff98ae424a6c6f8ffeb2 Mon Sep 17 00:00:00 2001 From: Andrea Panattoni Date: Thu, 1 Feb 2024 18:58:03 +0100 Subject: [PATCH] openstack: Fix `nil` HostManager in `openstackContext` Refactoring in [1] left the openstackContext uninitialized. [1] https://github.com/k8snetworkplumbingwg/sriov-network-operator/pull/553 Signed-off-by: Andrea Panattoni --- pkg/platforms/openstack/openstack.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/platforms/openstack/openstack.go b/pkg/platforms/openstack/openstack.go index b86e079ca2..6f7721838d 100644 --- a/pkg/platforms/openstack/openstack.go +++ b/pkg/platforms/openstack/openstack.go @@ -18,6 +18,7 @@ import ( sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/consts" "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/host" + "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils" ) const ( @@ -103,7 +104,11 @@ type OSPDeviceInfo struct { } func New() OpenstackInterface { - return &openstackContext{} + utilsHelper := utils.New() + hostManager := host.NewHostManager(utilsHelper) + return &openstackContext{ + hostManager: hostManager, + } } // GetOpenstackData gets the metadata and network_data