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:
parent
5d9907ae86
commit
f0f6bbcf36
1 changed files with 6 additions and 4 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue