mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-31 04:04:51 +00:00
Merge pull request #473 from marquiz/devel/log-readability
source/custom: dump config in more human-readable form
This commit is contained in:
commit
c7442f81b0
1 changed files with 3 additions and 2 deletions
|
@ -21,6 +21,7 @@ import (
|
||||||
|
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
|
|
||||||
|
"sigs.k8s.io/node-feature-discovery/pkg/utils"
|
||||||
"sigs.k8s.io/node-feature-discovery/source"
|
"sigs.k8s.io/node-feature-discovery/source"
|
||||||
"sigs.k8s.io/node-feature-discovery/source/custom/rules"
|
"sigs.k8s.io/node-feature-discovery/source/custom/rules"
|
||||||
)
|
)
|
||||||
|
@ -37,7 +38,7 @@ type MatchRule struct {
|
||||||
|
|
||||||
type FeatureSpec struct {
|
type FeatureSpec struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Value *string `json:"value"`
|
Value *string `json:"value,omitempty"`
|
||||||
MatchOn []MatchRule `json:"matchOn"`
|
MatchOn []MatchRule `json:"matchOn"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +78,7 @@ func (s Source) Discover() (source.Features, error) {
|
||||||
features := source.Features{}
|
features := source.Features{}
|
||||||
allFeatureConfig := append(getStaticFeatureConfig(), *s.config...)
|
allFeatureConfig := append(getStaticFeatureConfig(), *s.config...)
|
||||||
allFeatureConfig = append(allFeatureConfig, getDirectoryFeatureConfig()...)
|
allFeatureConfig = append(allFeatureConfig, getDirectoryFeatureConfig()...)
|
||||||
klog.V(1).Infof("Custom features: %+v", allFeatureConfig)
|
utils.KlogDump(2, "custom features configuration:", " ", allFeatureConfig)
|
||||||
// Iterate over features
|
// Iterate over features
|
||||||
for _, customFeature := range allFeatureConfig {
|
for _, customFeature := range allFeatureConfig {
|
||||||
featureExist, err := s.discoverFeature(customFeature)
|
featureExist, err := s.discoverFeature(customFeature)
|
||||||
|
|
Loading…
Add table
Reference in a new issue