From 388729e9b1623db1b767e4675c5915a5e5ce5226 Mon Sep 17 00:00:00 2001 From: zryfish Date: Wed, 29 Jul 2020 13:25:52 +0800 Subject: [PATCH] fix incorrect error log (#2694) Signed-off-by: Jeff --- pkg/controller/user/user_controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/controller/user/user_controller.go b/pkg/controller/user/user_controller.go index 039d5686..e89c45a0 100644 --- a/pkg/controller/user/user_controller.go +++ b/pkg/controller/user/user_controller.go @@ -141,8 +141,9 @@ func NewUserController(k8sClient kubernetes.Interface, ksClient kubesphere.Inter loginRecordInformer.Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ AddFunc: func(new interface{}) { - err := ctl.enqueueLogin(new) - klog.Errorf("Failed to enqueue login object, error: %v", err) + if err := ctl.enqueueLogin(new); err != nil { + klog.Errorf("Failed to enqueue login object, error: %v", err) + } }, }) return ctl -- GitLab