1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-15 04:57:56 +00:00

nfd-master: configure before prune

Otherwise prune will crash because of uninitialized configuration.
This commit is contained in:
Markus Lehtonen 2023-04-19 15:54:32 +03:00
parent 5d9907ae86
commit f0f6bbcf36

View file

@ -185,6 +185,11 @@ func (m *nfdMaster) Run() error {
klog.Infof("NodeName: %q", m.nodeName)
klog.Infof("Kubernetes namespace: %q", m.namespace)
// Read initial configuration
if err := m.configure(m.configFilePath, m.args.Options); err != nil {
return err
}
if m.args.Prune {
return m.prune()
}
@ -201,14 +206,11 @@ func (m *nfdMaster) Run() error {
}
}
// Create watcher for config file and read initial configuration
// Create watcher for config file
configWatch, err := utils.CreateFsWatcher(time.Second, m.configFilePath)
if err != nil {
return err
}
if err := m.configure(m.configFilePath, m.args.Options); err != nil {
return err
}
if !m.config.NoPublish {
err := m.updateMasterNode()