Skip to content

Commit

Permalink
nfd-master: use term node update instead of labeling
Browse files Browse the repository at this point in the history
Rename symbols and reword log messages to correlate with the
functionality (we may do other updates than just modify labels
nowadays).
  • Loading branch information
marquiz committed Aug 1, 2023
1 parent d8f167d commit 039378c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/nfd-master/node-updater-pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func newNodeUpdaterPool(nfdMaster *nfdMaster) *nodeUpdaterPool {
}
}

func (u *nodeUpdaterPool) processNodeLabelRequest(queue workqueue.RateLimitingInterface) bool {
func (u *nodeUpdaterPool) processNodeUpdateRequest(queue workqueue.RateLimitingInterface) bool {
nodeName, quit := queue.Get()
if quit {
return false
Expand All @@ -48,19 +48,19 @@ func (u *nodeUpdaterPool) processNodeLabelRequest(queue workqueue.RateLimitingIn

if err := u.nfdMaster.nfdAPIUpdateOneNode(nodeName.(string)); err != nil {
if queue.NumRequeues(nodeName) < 5 {
klog.InfoS("retrying labeling request for node", "nodeName", nodeName)
klog.InfoS("retrying node update", "nodeName", nodeName)

Check warning on line 51 in pkg/nfd-master/node-updater-pool.go

View check run for this annotation

Codecov / codecov/patch

pkg/nfd-master/node-updater-pool.go#L51

Added line #L51 was not covered by tests
queue.AddRateLimited(nodeName)
return true
} else {
klog.ErrorS(err, "error labeling node", "nodeName", nodeName)
klog.ErrorS(err, "failed to update node", "nodeName", nodeName)

Check warning on line 55 in pkg/nfd-master/node-updater-pool.go

View check run for this annotation

Codecov / codecov/patch

pkg/nfd-master/node-updater-pool.go#L55

Added line #L55 was not covered by tests
}
}
queue.Forget(nodeName)
return true
}

func (u *nodeUpdaterPool) runNodeUpdater(queue workqueue.RateLimitingInterface) {
for u.processNodeLabelRequest(queue) {
for u.processNodeUpdateRequest(queue) {
}
u.wg.Done()
}
Expand Down

0 comments on commit 039378c

Please sign in to comment.