Skip to content

Commit

Permalink
Reduce SriovOperator verbosity
Browse files Browse the repository at this point in the history
In `renderDevicePluginConfigData()`, avoid
logging the full ResourceList for every resource in the loop.

Avoid logging in helper functions, as they can be invoked in loops.

Signed-off-by: Andrea Panattoni <[email protected]>
  • Loading branch information
zeeke committed Jul 14, 2023
1 parent 064df38 commit ed9d2db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion api/v1/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ func (p *SriovNetworkNodePolicy) Selected(node *corev1.Node) bool {
}
return false
}
log.Info("Selected():", "node", node.Name)
return true
}

Expand Down
4 changes: 2 additions & 2 deletions controllers/sriovnetworknodepolicy_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ func renderDsForCR(path string, data *render.RenderData) ([]*uns.Unstructured, e

func (r *SriovNetworkNodePolicyReconciler) renderDevicePluginConfigData(ctx context.Context, pl *sriovnetworkv1.SriovNetworkNodePolicyList, node *corev1.Node) (dptypes.ResourceConfList, error) {
logger := log.Log.WithName("renderDevicePluginConfigData")
logger.Info("Start to render device plugin config data")
logger.Info("Start to render device plugin config data", "node", node.Name)
rcl := dptypes.ResourceConfList{}
for _, p := range pl.Items {
if p.Name == constants.DefaultPolicyName {
Expand Down Expand Up @@ -608,7 +608,7 @@ func (r *SriovNetworkNodePolicyReconciler) renderDevicePluginConfigData(ctx cont
return rcl, err
}
rcl.ResourceList = append(rcl.ResourceList, *rc)
logger.Info("Add resource", "Resource", *rc, "Resource list", rcl.ResourceList)
logger.Info("Add resource", "Resource", *rc)
}
}
return rcl, nil
Expand Down

0 comments on commit ed9d2db

Please sign in to comment.