Skip to content

Commit

Permalink
nfd-worker: improved log when creating NodeFeature object
Browse files Browse the repository at this point in the history
Don't log an empty NodeFeature object.
  • Loading branch information
marquiz committed May 23, 2024
1 parent 6644b6a commit 6490369
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/nfd-worker/nfd-worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,6 @@ func (m *nfdWorker) updateNodeFeatureObject(labels Labels) error {
// TODO: we could implement some simple caching of the object, only get it
// every 10 minutes or so because nobody else should really be modifying it
if nfr, err := cli.NfdV1alpha1().NodeFeatures(namespace).Get(context.TODO(), nodename, metav1.GetOptions{}); errors.IsNotFound(err) {
klog.InfoS("creating NodeFeature object", "nodefeature", klog.KObj(nfr))
nfr = &nfdv1alpha1.NodeFeature{
ObjectMeta: metav1.ObjectMeta{
Name: nodename,
Expand All @@ -748,6 +747,7 @@ func (m *nfdWorker) updateNodeFeatureObject(labels Labels) error {
Labels: labels,
},
}
klog.InfoS("creating NodeFeature object", "nodefeature", klog.KObj(nfr))

Check warning on line 750 in pkg/nfd-worker/nfd-worker.go

View check run for this annotation

Codecov / codecov/patch

pkg/nfd-worker/nfd-worker.go#L750

Added line #L750 was not covered by tests

nfrCreated, err := cli.NfdV1alpha1().NodeFeatures(namespace).Create(context.TODO(), nfr, metav1.CreateOptions{})
if err != nil {
Expand Down

0 comments on commit 6490369

Please sign in to comment.