mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-16 13:28:18 +00:00
Specify a new interface for managing "raw" feature data. This is the first step to separate raw feature data from node labels. None of the feature sources implement this interface, yet. This patch unifies the data format of "raw" features by dividing them into three different basic types. - keys, a set of names without any associated values, e.g. CPUID flags or loaded kernel modules - values, a map of key-value pairs, for features with a single value, e.g. kernel config flags or os version - instances, a list of instances each of which has multiple attributes (key-value pairs of their own), e.g. PCI or USB devices The new feature data types are defined in a new "pkg/api/feature" package, catering decoupling and re-usability of code e.g. within future extentions of the NFD gRPC API. Rename the Discover() method of LabelSource interface to GetLabels().
63 lines
1.2 KiB
Go
63 lines
1.2 KiB
Go
// Code generated by mockery v1.0.0. DO NOT EDIT.
|
|
|
|
// Re-generate by running 'make mock'
|
|
|
|
package source
|
|
|
|
import mock "github.com/stretchr/testify/mock"
|
|
|
|
// MockLabelSource is an autogenerated mock type for the LabelSource type
|
|
type MockLabelSource struct {
|
|
mock.Mock
|
|
}
|
|
|
|
// GetLabels provides a mock function with given fields:
|
|
func (_m *MockLabelSource) GetLabels() (FeatureLabels, error) {
|
|
ret := _m.Called()
|
|
|
|
var r0 FeatureLabels
|
|
if rf, ok := ret.Get(0).(func() FeatureLabels); ok {
|
|
r0 = rf()
|
|
} else {
|
|
if ret.Get(0) != nil {
|
|
r0 = ret.Get(0).(FeatureLabels)
|
|
}
|
|
}
|
|
|
|
var r1 error
|
|
if rf, ok := ret.Get(1).(func() error); ok {
|
|
r1 = rf()
|
|
} else {
|
|
r1 = ret.Error(1)
|
|
}
|
|
|
|
return r0, r1
|
|
}
|
|
|
|
// Name provides a mock function with given fields:
|
|
func (_m *MockLabelSource) Name() string {
|
|
ret := _m.Called()
|
|
|
|
var r0 string
|
|
if rf, ok := ret.Get(0).(func() string); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(string)
|
|
}
|
|
|
|
return r0
|
|
}
|
|
|
|
// Priority provides a mock function with given fields:
|
|
func (_m *MockLabelSource) Priority() int {
|
|
ret := _m.Called()
|
|
|
|
var r0 int
|
|
if rf, ok := ret.Get(0).(func() int); ok {
|
|
r0 = rf()
|
|
} else {
|
|
r0 = ret.Get(0).(int)
|
|
}
|
|
|
|
return r0
|
|
}
|