Skip to content

Commit

Permalink
nfd-master: check for nil references in nfdAPIUpdateAllNodes
Browse files Browse the repository at this point in the history
Just a safeguard.
  • Loading branch information
marquiz committed Jul 17, 2023
1 parent 9a108c0 commit dac45be
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/nfd-master/nfd-master.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,10 @@ func (m *nfdMaster) nfdAPIUpdateAllNodes() error {
}

func (m *nfdMaster) nfdAPIUpdateOneNode(nodeName string) error {
if m.nfdController == nil || m.nfdController.featureLister == nil {
return nil
}

Check warning on line 698 in pkg/nfd-master/nfd-master.go

View check run for this annotation

Codecov / codecov/patch

pkg/nfd-master/nfd-master.go#L696-L698

Added lines #L696 - L698 were not covered by tests

sel := k8sLabels.SelectorFromSet(k8sLabels.Set{nfdv1alpha1.NodeFeatureObjNodeNameLabel: nodeName})
objs, err := m.nfdController.featureLister.List(sel)
if err != nil {
Expand Down

0 comments on commit dac45be

Please sign in to comment.