mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-14 20:56:42 +00:00
source/usb: fix fallback to default label format
This commit is contained in:
parent
afe07d6e19
commit
19e0f77cb5
1 changed files with 4 additions and 2 deletions
|
@ -43,10 +43,12 @@ func newDefaultConfig() *Config {
|
|||
// By default these include classes where different accelerators are typically mapped:
|
||||
// Video (0e), Miscellaneous (ef), Application Specific (fe), and Vendor Specific (ff).
|
||||
DeviceClassWhitelist: []string{"0e", "ef", "fe", "ff"},
|
||||
DeviceLabelFields: []string{"class", "vendor", "device"},
|
||||
DeviceLabelFields: defaultDeviceLabelFields(),
|
||||
}
|
||||
}
|
||||
|
||||
func defaultDeviceLabelFields() []string { return []string{"class", "vendor", "device"} }
|
||||
|
||||
// usbSource implements the LabelSource and ConfigurableSource interfaces.
|
||||
type usbSource struct {
|
||||
config *Config
|
||||
|
@ -110,7 +112,7 @@ func (s *usbSource) GetLabels() (source.FeatureLabels, error) {
|
|||
}
|
||||
if len(deviceLabelFields) == 0 {
|
||||
klog.Warningf("no valid fields in deviceLabelFields defined, using the defaults")
|
||||
deviceLabelFields = []string{"vendor", "device"}
|
||||
deviceLabelFields = defaultDeviceLabelFields()
|
||||
}
|
||||
|
||||
// Iterate over all device classes
|
||||
|
|
Loading…
Add table
Reference in a new issue