1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-15 17:50:49 +00:00

nfd-worker: don't log labels returned by sources by default

Reduce default log verbosity. Only print out labels if log verbosity is
1 or higher ('core.klog.v: 1' config file option or '-v 1' on command
line). Also, dump the labels in a reproducible (sorted) format.
This commit is contained in:
Markus Lehtonen 2021-03-10 21:09:47 +02:00
parent 8d67fc1122
commit 6c6249a599

View file

@ -508,6 +508,7 @@ func createFeatureLabels(sources []source.FeatureSource, labelWhiteList regexp.R
labels = Labels{}
// Do feature discovery from all configured sources.
klog.Info("starting feature discovery...")
for _, source := range sources {
labelsFromSource, err := getFeatureLabels(source, labelWhiteList)
if err != nil {
@ -516,11 +517,11 @@ func createFeatureLabels(sources []source.FeatureSource, labelWhiteList regexp.R
}
for name, value := range labelsFromSource {
// Log discovered feature.
klog.Infof("%s = %s", name, value)
labels[name] = value
}
}
klog.Info("feature discovery completed")
utils.KlogDump(1, "labels discovered by feature sources:", " ", labels)
return labels
}