mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2025-03-28 10:47:23 +00:00
Merge pull request #1160 from marquiz/fixes/prune
nfd-master: fix -prune
This commit is contained in:
commit
e0b076e08b
2 changed files with 7 additions and 4 deletions
|
@ -12,6 +12,7 @@ resources:
|
|||
|
||||
components:
|
||||
- ../../components/common
|
||||
- ../../components/master-config
|
||||
|
||||
patches:
|
||||
- path: master-clusterrole.yaml
|
||||
|
|
|
@ -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