1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-31 04:04:51 +00:00

Merge pull request #1850 from marquiz/release-0.16

[release-0.16] nfd-master: proper shutdown of nfd api informers
This commit is contained in:
Kubernetes Prow Robot 2024-08-20 04:11:26 -07:00 committed by GitHub
commit 86bf44fd32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 3 deletions

View file

@ -187,7 +187,10 @@ func (c *nfdController) updateOneNode(typ string, obj metav1.Object) {
klog.ErrorS(err, "failed to determine node name for object", "type", typ, "object", klog.KObj(obj))
return
}
c.updateOneNodeChan <- nodeName
select {
case c.updateOneNodeChan <- nodeName:
case <-c.stopChan:
}
}
func (c *nfdController) updateAllNodes() {
@ -198,7 +201,10 @@ func (c *nfdController) updateAllNodes() {
}
func (c *nfdController) updateNodeFeatureGroup(nodeFeatureGroup string) {
c.updateNodeFeatureGroupChan <- nodeFeatureGroup
select {
case c.updateNodeFeatureGroupChan <- nodeFeatureGroup:
case <-c.stopChan:
}
}
func (c *nfdController) updateAllNodeFeatureGroups() {

View file

@ -393,7 +393,7 @@ func (m *nfdMaster) Run() error {
// Update all nodes when the configuration changes
if m.nfdController != nil && nfdfeatures.NFDFeatureGate.Enabled(nfdfeatures.NodeFeatureAPI) && m.args.EnableNodeFeatureApi {
m.nfdController.updateAllNodesChan <- struct{}{}
m.nfdController.updateAllNodes()
}
case <-m.stop: