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

Merge pull request #1127 from marquiz/devel/nfd-master-retry

nfd-master: re-try on node update failures
This commit is contained in:
Kubernetes Prow Robot 2023-04-13 07:14:39 -07:00 committed by GitHub
commit f9cc798057
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -329,21 +329,25 @@ func (m *nfdMaster) nfdAPIUpdateHandler() {
case <-rateLimit:
// Check what we need to do
// TODO: we might want to update multiple nodes in parallel
errUpdateAll := false
errNodes := make(map[string]struct{})
if updateAll {
if err := m.nfdAPIUpdateAllNodes(); err != nil {
klog.Error(err)
errUpdateAll = true
}
} else {
for nodeName := range updateNodes {
if err := m.nfdAPIUpdateOneNode(nodeName); err != nil {
klog.Error(err)
errNodes[nodeName] = struct{}{}
}
}
}
// Reset "work queue" and timer
updateAll = false
updateNodes = make(map[string]struct{})
// Reset "work queue" and timer, will cause re-try if errors happened
updateAll = errUpdateAll
updateNodes = errNodes
rateLimit = time.After(time.Second)
}
}