1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 02:37:11 +00:00

Added fake feature source for testing purposes.

This commit is contained in:
Balaji Subramaniam 2016-10-25 14:57:40 -07:00
parent 31ec89474a
commit af0f97dcef
2 changed files with 17 additions and 0 deletions

View file

@ -94,6 +94,7 @@ func main() {
cpuidSource{},
rdtSource{},
pstateSource{},
fakeSource{},
}
sources := []FeatureSource{}

View file

@ -102,3 +102,19 @@ func (s pstateSource) Discover() ([]string, error) {
return features, nil
}
////////////////////////////////////////////////////////////////////////////////
// Fake Source (used only for testing)
// Implements main.FeatureSource.
type fakeSource struct{}
func (s fakeSource) Name() string { return "fake" }
func (s fakeSource) Discover() ([]string, error) {
features := []string{}
// Adding three fake features.
features = append(features, "fakefeature1", "fakefeature2", "fakefeature3")
return features, nil
}