Skip to content

Commit

Permalink
Merge pull request #1191 from marquiz/devel/master-logging
Browse files Browse the repository at this point in the history
nfd-master: log node name when processing NodeFeatureRules
  • Loading branch information
k8s-ci-robot authored Apr 26, 2023
2 parents 14fed55 + 77011a7 commit dbb0690
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/nfd-master/nfd-master.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ func (m *nfdMaster) refreshNodeFeatures(cli *kubernetes.Clientset, nodeName stri
labels = make(map[string]string)
}

crLabels, crExtendedResources, crTaints := m.processNodeFeatureRule(features)
crLabels, crExtendedResources, crTaints := m.processNodeFeatureRule(nodeName, features)

// Mix in CR-originated labels
for k, v := range crLabels {
Expand Down Expand Up @@ -898,7 +898,7 @@ func authorizeClient(c context.Context, checkNodeName bool, nodeName string) err
return nil
}

func (m *nfdMaster) processNodeFeatureRule(features *nfdv1alpha1.Features) (Labels, ExtendedResources, []corev1.Taint) {
func (m *nfdMaster) processNodeFeatureRule(nodeName string, features *nfdv1alpha1.Features) (Labels, ExtendedResources, []corev1.Taint) {
if m.nfdController == nil {
return nil, nil, nil
}
Expand All @@ -920,15 +920,15 @@ func (m *nfdMaster) processNodeFeatureRule(features *nfdv1alpha1.Features) (Labe
for _, spec := range ruleSpecs {
switch {
case klog.V(3).Enabled():
h := fmt.Sprintf("executing NodeFeatureRule %q:", spec.Name)
h := fmt.Sprintf("executing NodeFeatureRule %q on node %q:", spec.Name, nodeName)
utils.KlogDump(3, h, " ", spec.Spec)
case klog.V(1).Enabled():
klog.Infof("executing NodeFeatureRule %q", spec.Name)
klog.Infof("executing NodeFeatureRule %q on node %q", spec.Name, nodeName)
}
for _, rule := range spec.Spec.Rules {
ruleOut, err := rule.Execute(features)
if err != nil {
klog.Errorf("failed to process Rule %q: %v", rule.Name, err)
klog.Errorf("failed to process Rule %q on node %q: %v", rule.Name, nodeName, err)
continue
}
taints = append(taints, ruleOut.Taints...)
Expand Down

0 comments on commit dbb0690

Please sign in to comment.