diff --git a/controllers/sriovoperatorconfig_controller.go b/controllers/sriovoperatorconfig_controller.go index 4dcdea8b0..157aaf532 100644 --- a/controllers/sriovoperatorconfig_controller.go +++ b/controllers/sriovoperatorconfig_controller.go @@ -123,7 +123,7 @@ func (r *SriovOperatorConfigReconciler) Reconcile(ctx context.Context, req ctrl. } // For Openshift we need to create the systemd files using a machine config - if constants.ClusterType == constants.ClusterTypeOpenshift && defaultConfig.Spec.ConfigurationMode == sriovnetworkv1.SystemdConfigurationMode { + if utils.ClusterType == utils.ClusterTypeOpenshift && defaultConfig.Spec.ConfigurationMode == sriovnetworkv1.SystemdConfigurationMode { if err = r.syncSystemdService(defaultConfig); err != nil { return reconcile.Result{}, err } diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index dd178e929..298ee970b 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -151,7 +151,7 @@ func New( useSystemdService: useSystemdService, client: client, kubeClient: kubeClient, - openshiftContext: openshiftContext, + openshiftContext: openshiftContext, exitCh: exitCh, stopCh: stopCh, syncCh: syncCh, diff --git a/pkg/daemon/daemon_test.go b/pkg/daemon/daemon_test.go index 0498cdb2b..d6d153ba1 100644 --- a/pkg/daemon/daemon_test.go +++ b/pkg/daemon/daemon_test.go @@ -109,6 +109,7 @@ var _ = Describe("Config Daemon", func() { syncCh, refreshCh, utils.Baremetal, + false, ) sut.enabledPlugins = map[string]plugin.VendorPlugin{generic.PluginName: &fake.FakePlugin{}} diff --git a/pkg/plugins/generic/generic_plugin_test.go b/pkg/plugins/generic/generic_plugin_test.go index e5722ece7..c731c46f4 100644 --- a/pkg/plugins/generic/generic_plugin_test.go +++ b/pkg/plugins/generic/generic_plugin_test.go @@ -20,7 +20,7 @@ var _ = Describe("Generic plugin", func() { var genericPlugin plugin.VendorPlugin var err error BeforeEach(func() { - genericPlugin, err = generic.NewGenericPlugin() + genericPlugin, err = generic.NewGenericPlugin(false) Expect(err).ToNot(HaveOccurred()) }) diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index e7d2fea19..d0de897e3 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -148,10 +148,10 @@ func DiscoverSriovDevices(withUnsupported bool) ([]sriovnetworkv1.InterfaceExt, // SyncNodeState Attempt to update the node state to match the desired state // func SyncNodeState(newState *sriovnetworkv1.SriovNetworkNodeState, pfsToConfig map[string]bool) error { - return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, vfsToConfig) + return ConfigSriovInterfaces(newState.Spec.Interfaces, newState.Status.Interfaces, pfsToConfig) } -func ConfigSriovInterfaces(interfaces []sriovnetworkv1.Interface, ifaceStatuses []sriovnetworkv1.InterfaceExt, vfsToConfig map[string]bool) error { +func ConfigSriovInterfaces(interfaces []sriovnetworkv1.Interface, ifaceStatuses []sriovnetworkv1.InterfaceExt, pfsToConfig map[string]bool) error { if IsKernelLockdownMode(true) && hasMellanoxInterfacesInSpec(ifaceStatuses, interfaces) { glog.Warningf("cannot use mellanox devices when in kernel lockdown mode") return fmt.Errorf("cannot use mellanox devices when in kernel lockdown mode")