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

k8snetworkplumbingwg / sriov-network-operator / 19331737185

13 Nov 2025 12:35PM UTC coverage: 62.137% (-0.2%) from 62.366%
19331737185

push

github

web-flow
Merge pull request #902 from SchSeba/create_platform_and_orchestrator_packages

Create platform and orchestrator packages

319 of 659 new or added lines in 25 files covered. (48.41%)

42 existing lines in 10 files now uncovered.

8770 of 14114 relevant lines covered (62.14%)

0.69 hits per line

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

54.84
/pkg/daemon/plugin.go
1
package daemon
2

3
import (
4
        "fmt"
5

6
        "sigs.k8s.io/controller-runtime/pkg/log"
7

8
        sriovnetworkv1 "github.com/k8snetworkplumbingwg/sriov-network-operator/api/v1"
9
        "github.com/k8snetworkplumbingwg/sriov-network-operator/pkg/vars"
10
)
11

12
func (dn *NodeReconciler) loadPlugins(ns *sriovnetworkv1.SriovNetworkNodeState, disabledPlugins []string) error {
1✔
13
        funcLog := log.Log.WithName("loadPlugins").WithValues("platform", vars.PlatformType, "orchestrator", vars.ClusterType)
1✔
14
        funcLog.Info("loading plugins", "disabled", disabledPlugins)
1✔
15

1✔
16
        mainPlugin, additionalPlugins, err := dn.platformInterface.GetVendorPlugins(ns)
1✔
17
        if err != nil {
1✔
NEW
18
                funcLog.Error(err, "Failed to load plugins", "platform", vars.PlatformType, "orchestrator", vars.ClusterType)
×
NEW
19
                return err
×
UNCOV
20
        }
×
21

22
        // Check if the main plugin is disabled - this is not allowed
23
        if isPluginDisabled(mainPlugin.Name(), disabledPlugins) {
1✔
NEW
24
                return fmt.Errorf("main plugin %s cannot be disabled", mainPlugin.Name())
×
UNCOV
25
        }
×
26
        dn.mainPlugin = mainPlugin
1✔
27

1✔
28
        for _, plugin := range additionalPlugins {
1✔
NEW
29
                if !isPluginDisabled(plugin.Name(), disabledPlugins) {
×
NEW
30
                        dn.additionalPlugins = append(dn.additionalPlugins, plugin)
×
UNCOV
31
                }
×
32
        }
33

34
        additionalPluginsName := make([]string, len(dn.additionalPlugins))
1✔
35
        for idx, plugin := range dn.additionalPlugins {
1✔
NEW
36
                additionalPluginsName[idx] = plugin.Name()
×
NEW
37
        }
×
38

39
        log.Log.Info("loaded plugins", "mainPlugin", dn.mainPlugin.Name(), "additionalPlugins", additionalPluginsName)
1✔
40
        return nil
1✔
41
}
42

43
func isPluginDisabled(pluginName string, disabledPlugins []string) bool {
1✔
44
        for _, p := range disabledPlugins {
1✔
UNCOV
45
                if p == pluginName {
×
UNCOV
46
                        log.Log.V(2).Info("plugin is disabled", "name", pluginName)
×
UNCOV
47
                        return true
×
UNCOV
48
                }
×
49
        }
50
        return false
1✔
51
}
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

© 2026 Coveralls, Inc