1
0
Fork 0
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:
Kubernetes Prow Robot 2023-04-21 05:11:11 -07:00 committed by GitHub
commit e0b076e08b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -12,6 +12,7 @@ resources:
components:
- ../../components/common
- ../../components/master-config
patches:
- path: master-clusterrole.yaml

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()