Skip to content

Commit

Permalink
Remove logic that installs rdma-core package
Browse files Browse the repository at this point in the history
The logic removed to align the code  for all platforms.
Before this change the state was following:
* Ubuntu - the logic is completely broken and newer executed
* RHCOS - validation only
* RHEL - package installation (partially broken in RHEL 8 and RHEL 9)

The commit changes logic for all OS to do a validation only.

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
  • Loading branch information
ykulazhenkov committed Jul 24, 2024
1 parent ee40683 commit 7c5b97c
Show file tree
Hide file tree
Showing 9 changed files with 53 additions and 666 deletions.
4 changes: 2 additions & 2 deletions cmd/sriov-network-config-daemon/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func phasePre(setupLog logr.Logger, conf *systemd.SriovConfig, hostHelpers helpe
return fmt.Errorf("failed to remove sriov result file: %v", err)
}

_, err := hostHelpers.TryEnableRdma()
_, err := hostHelpers.CheckRDMAEnabled()
if err != nil {
setupLog.Error(err, "warning, failed to enable RDMA")
setupLog.Error(err, "warning, failed to check RDMA state")
}
hostHelpers.TryEnableTun()
hostHelpers.TryEnableVhostNet()
Expand Down
6 changes: 3 additions & 3 deletions cmd/sriov-network-config-daemon/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ var _ = Describe("Service", func() {
"/etc/sriov-operator/sriov-interface-result.yaml": []byte("something"),
},
})
hostHelpers.EXPECT().TryEnableRdma().Return(true, nil)
hostHelpers.EXPECT().CheckRDMAEnabled().Return(true, nil)
hostHelpers.EXPECT().TryEnableTun().Return()
hostHelpers.EXPECT().TryEnableVhostNet().Return()
hostHelpers.EXPECT().DiscoverSriovDevices(hostHelpers).Return([]sriovnetworkv1.InterfaceExt{{
Expand All @@ -183,7 +183,7 @@ var _ = Describe("Service", func() {
"/etc/sriov-operator/sriov-interface-result.yaml": []byte("something"),
},
})
hostHelpers.EXPECT().TryEnableRdma().Return(true, nil)
hostHelpers.EXPECT().CheckRDMAEnabled().Return(true, nil)
hostHelpers.EXPECT().TryEnableTun().Return()
hostHelpers.EXPECT().TryEnableVhostNet().Return()

Expand Down Expand Up @@ -211,7 +211,7 @@ var _ = Describe("Service", func() {
"/etc/sriov-operator/sriov-interface-result.yaml": []byte("something"),
},
})
hostHelpers.EXPECT().TryEnableRdma().Return(true, nil)
hostHelpers.EXPECT().CheckRDMAEnabled().Return(true, nil)
hostHelpers.EXPECT().TryEnableTun().Return()
hostHelpers.EXPECT().TryEnableVhostNet().Return()
hostHelpers.EXPECT().DiscoverSriovDevices(hostHelpers).Return([]sriovnetworkv1.InterfaceExt{{
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (dn *Daemon) Run(stopCh <-chan struct{}, exitCh <-chan error) error {

if !vars.UsingSystemdMode {
log.Log.V(0).Info("Run(): daemon running in daemon mode")
dn.HostHelpers.TryEnableRdma()
dn.HostHelpers.CheckRDMAEnabled()
dn.HostHelpers.TryEnableTun()
dn.HostHelpers.TryEnableVhostNet()
err := systemd.CleanSriovFilesFromHost(vars.ClusterType == consts.ClusterTypeOpenshift)
Expand Down
2 changes: 1 addition & 1 deletion pkg/daemon/daemon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ var _ = Describe("Config Daemon", func() {
platformHelper.EXPECT().IsHypershift().Return(false).AnyTimes()

vendorHelper := mock_helper.NewMockHostHelpersInterface(mockCtrl)
vendorHelper.EXPECT().TryEnableRdma().Return(true, nil).AnyTimes()
vendorHelper.EXPECT().CheckRDMAEnabled().Return(true, nil).AnyTimes()
vendorHelper.EXPECT().TryEnableVhostNet().AnyTimes()
vendorHelper.EXPECT().TryEnableTun().AnyTimes()
vendorHelper.EXPECT().PrepareNMUdevRule([]string{"0x1014", "0x154c"}).Return(nil).AnyTimes()
Expand Down
177 changes: 15 additions & 162 deletions pkg/helper/mock/mock_helper.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions pkg/host/internal/common.go

This file was deleted.

Loading

0 comments on commit 7c5b97c

Please sign in to comment.