Skip to content

Commit

Permalink
Merge pull request #1291 from marquiz/devel/master-renaming
Browse files Browse the repository at this point in the history
nfd-master: use term node update instead of labeling
  • Loading branch information
k8s-ci-robot authored Aug 4, 2023
2 parents 35fbbaa + 039378c commit 6caf554
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion pkg/nfd-master/nfd-master.go
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ func filterExtendedResource(name, value string, features *nfdv1alpha1.Features)
}

func (m *nfdMaster) refreshNodeFeatures(cli *kubernetes.Clientset, nodeName string, annotations Annotations, labels map[string]string, features *nfdv1alpha1.Features) error {

if labels == nil {
labels = make(map[string]string)
}
Expand Down
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)
queue.AddRateLimited(nodeName)
return true
} else {
klog.ErrorS(err, "error labeling node", "nodeName", nodeName)
klog.ErrorS(err, "failed to update node", "nodeName", nodeName)
}
}
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 6caf554

Please sign in to comment.