Skip to content

Commit 8affb9d

Browse files
committed
Revert "nfd-master: use only unbuffered chans in the nfd api-controller"
Fixes a bug where updates to NodeFeatureGroup objects were not happening after the initial sync. We need to use buffered channels for the "update all" channels as there is the default: case in select that is sending the update all signal (to the channel). An alternative would be to remove the default: case from the select block but it is more efficient this way - just skip if the reader side hasn't yet got the "update all" signal. This reverts commit bf6ffad.
1 parent 0ef859f commit 8affb9d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/nfd-master/nfd-api-controller.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ func init() {
6666
func newNfdController(config *restclient.Config, nfdApiControllerOptions nfdApiControllerOptions) (*nfdController, error) {
6767
c := &nfdController{
6868
stopChan: make(chan struct{}),
69-
updateAllNodesChan: make(chan struct{}),
69+
updateAllNodesChan: make(chan struct{}, 1),
7070
updateOneNodeChan: make(chan string),
71-
updateAllNodeFeatureGroupsChan: make(chan struct{}),
71+
updateAllNodeFeatureGroupsChan: make(chan struct{}, 1),
7272
updateNodeFeatureGroupChan: make(chan string),
7373
}
7474

0 commit comments

Comments
 (0)