Skip to content

Commit 771cfc8

Browse files
Merge pull request #2842 from ncdc/no-direct-klog
🌱 Remove direct klog usage
2 parents 6434142 + e544558 commit 771cfc8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

hack/logcheck.out

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
/pkg/reconciler/cache/labelclusterroles/labelclusterrole_controller.go:148:3: function "Errorf" should not be used, convert to contextual logging

pkg/reconciler/cache/labelclusterroles/labelclusterrole_controller.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ type controller struct {
145145
func (c *controller) EnqueueClusterRoles(values ...interface{}) {
146146
clusterRoles, err := c.clusterRoleLister.List(labels.Everything())
147147
if err != nil {
148-
klog.Errorf("Error listing ClusterRoles: %v", err)
148+
logger := logging.WithReconciler(klog.Background(), c.controllerName)
149+
logger.Error(err, "error listing ClusterRoles")
149150
return
150151
}
151152
for _, cr := range clusterRoles {

0 commit comments

Comments
 (0)