1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2024-12-14 11:57:51 +00:00

nfd-worker: provide deprecated core.sources config option

Provide backwards compatibility via a deprecated 'core.sources' config
file option. This will override 'core.labelSources'. A warning is
printed in the log if this option is detected.
This commit is contained in:
Markus Lehtonen 2021-11-25 11:24:09 +02:00
parent ad9c7dfa1e
commit 773280de65

View file

@ -64,6 +64,7 @@ type coreConfig struct {
Klog map[string]string
LabelWhiteList utils.RegexpVal
NoPublish bool
Sources *[]string
LabelSources []string
SleepInterval duration
}
@ -358,6 +359,12 @@ func (w *nfdWorker) configure(filepath string, overrides string) error {
if err != nil {
return fmt.Errorf("failed to parse config file: %s", err)
}
if c.Core.Sources != nil {
klog.Warningf("found deprecated 'core.sources' config file option, please use 'core.labelSources' instead")
c.Core.LabelSources = *c.Core.Sources
}
klog.Infof("configuration file %q parsed", filepath)
}
}