1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 02:37:11 +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:
Kubernetes Prow Robot 2021-03-17 12:03:19 -07:00 committed by GitHub
commit c7442f81b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@ import (
"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/custom/rules"
)
@ -37,7 +38,7 @@ type MatchRule struct {
type FeatureSpec struct {
Name string `json:"name"`
Value *string `json:"value"`
Value *string `json:"value,omitempty"`
MatchOn []MatchRule `json:"matchOn"`
}
@ -77,7 +78,7 @@ func (s Source) Discover() (source.Features, error) {
features := source.Features{}
allFeatureConfig := append(getStaticFeatureConfig(), *s.config...)
allFeatureConfig = append(allFeatureConfig, getDirectoryFeatureConfig()...)
klog.V(1).Infof("Custom features: %+v", allFeatureConfig)
utils.KlogDump(2, "custom features configuration:", " ", allFeatureConfig)
// Iterate over features
for _, customFeature := range allFeatureConfig {
featureExist, err := s.discoverFeature(customFeature)