• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

k8snetworkplumbingwg / sriov-network-operator / 10058808149

23 Jul 2024 12:22PM UTC coverage: 43.964% (+0.6%) from 43.351%
10058808149

Pull #659

github

web-flow
Merge f199eb95f into 588abb449
Pull Request #659: Configure IB VFs' GUIDs using a statically provided GUID pool

212 of 280 new or added lines in 13 files covered. (75.71%)

2 existing lines in 1 file now uncovered.

6526 of 14844 relevant lines covered (43.96%)

0.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/helper/host.go
1
package helper
2

3
import (
4
        "sigs.k8s.io/controller-runtime/pkg/log"
5

6
        "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/host"
7
        "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/host/store"
8
        "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/utils"
9
        mlx "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/vendors/mellanox"
10
)
11

12
//go:generate ../../bin/mockgen -destination mock/mock_helper.go -source host.go
13
type HostHelpersInterface interface {
14
        utils.CmdInterface
15
        host.HostManagerInterface
16
        store.ManagerInterface
17
        mlx.MellanoxInterface
18
}
19

20
type hostHelpers struct {
21
        utils.CmdInterface
22
        host.HostManagerInterface
23
        store.ManagerInterface
24
        mlx.MellanoxInterface
25
}
26

27
// Use for unit tests
28
func NewHostHelpers(utilsHelper utils.CmdInterface,
29
        hostManager host.HostManagerInterface,
30
        storeManager store.ManagerInterface,
31
        mlxHelper mlx.MellanoxInterface) HostHelpersInterface {
×
32
        return &hostHelpers{utilsHelper, hostManager, storeManager, mlxHelper}
×
33
}
×
34

35
func NewDefaultHostHelpers() (HostHelpersInterface, error) {
×
36
        utilsHelper := utils.New()
×
37
        mlxHelper := mlx.New(utilsHelper)
×
NEW
38
        hostManager, err := host.NewHostManager(utilsHelper)
×
NEW
39
        if err != nil {
×
NEW
40
                log.Log.Error(err, "failed to create host manager")
×
NEW
41
                return nil, err
×
NEW
42
        }
×
43
        storeManager, err := store.NewManager()
×
44
        if err != nil {
×
45
                log.Log.Error(err, "failed to create store manager")
×
46
                return nil, err
×
47
        }
×
48

49
        return &hostHelpers{
×
50
                utilsHelper,
×
51
                hostManager,
×
52
                storeManager,
×
53
                mlxHelper}, nil
×
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc