Skip to content

Commit b30c170

Browse files
authored
Merge pull request #6567 from wangbowen1401/master
JSON logging for RB Status Controller
2 parents a2c2057 + fd82415 commit b30c170

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/controllers/status/rb_status_controller.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type RBStatusController struct {
5858
// The Controller will requeue the Request to be processed again if an error is non-nil or
5959
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
6060
func (c *RBStatusController) Reconcile(ctx context.Context, req controllerruntime.Request) (controllerruntime.Result, error) {
61-
klog.V(4).Infof("Reconciling ResourceBinding %s.", req.NamespacedName.String())
61+
klog.V(4).InfoS("Reconciling ResourceBinding", "namespace", req.Namespace, "name", req.Name)
6262

6363
binding := &workv1alpha2.ResourceBinding{}
6464
if err := c.Client.Get(ctx, req.NamespacedName, binding); err != nil {
@@ -114,8 +114,7 @@ func (c *RBStatusController) SetupWithManager(mgr controllerruntime.Manager) err
114114
func (c *RBStatusController) syncBindingStatus(ctx context.Context, binding *workv1alpha2.ResourceBinding) error {
115115
err := helper.AggregateResourceBindingWorkStatus(ctx, c.Client, binding, c.EventRecorder)
116116
if err != nil {
117-
klog.Errorf("Failed to aggregate workStatus to resourceBinding(%s/%s), Error: %v",
118-
binding.Namespace, binding.Name, err)
117+
klog.ErrorS(err, "Failed to aggregate workStatues to ResourceBinding", "namespace", binding.Namespace, "name", binding.Name)
119118
return err
120119
}
121120

0 commit comments

Comments
 (0)