@@ -49,7 +49,7 @@ type RemedyController struct {
49
49
// The Controller will requeue the Request to be processed again if an error is non-nil or
50
50
// Result.Requeue is true, otherwise upon completion it will remove the work from the queue.
51
51
func (c * RemedyController ) Reconcile (ctx context.Context , req controllerruntime.Request ) (controllerruntime.Result , error ) {
52
- klog .V (4 ).Infof ("Start to reconcile cluster(%s) " , req .NamespacedName .String ())
52
+ klog .V (4 ).InfoS ("Start to reconcile cluster" , "cluster " , req .NamespacedName .String ())
53
53
cluster := & clusterv1alpha1.Cluster {}
54
54
if err := c .Client .Get (ctx , req .NamespacedName , cluster ); err != nil {
55
55
if apierrors .IsNotFound (err ) {
@@ -64,7 +64,7 @@ func (c *RemedyController) Reconcile(ctx context.Context, req controllerruntime.
64
64
65
65
clusterRelatedRemedies , err := getClusterRelatedRemedies (ctx , c .Client , cluster )
66
66
if err != nil {
67
- klog .Errorf ( "Failed to get cluster(%s) related remedies: %v" , cluster .Name , err )
67
+ klog .ErrorS ( err , "Failed to get cluster related remedies" , "cluster" , cluster .Name )
68
68
return controllerruntime.Result {}, err
69
69
}
70
70
@@ -76,10 +76,10 @@ func (c *RemedyController) Reconcile(ctx context.Context, req controllerruntime.
76
76
})
77
77
return err
78
78
}); err != nil {
79
- klog .Errorf ( "Failed to sync cluster(%s) remedy actions: %v" , cluster .Name , err )
79
+ klog .ErrorS ( err , "Failed to sync cluster remedy actions" , "cluster" , cluster .Name )
80
80
return controllerruntime.Result {}, err
81
81
}
82
- klog .V (4 ).Infof ("Success to sync cluster(%s) remedy actions: %v" , cluster .Name , actions )
82
+ klog .V (4 ).InfoS ("Success to sync cluster remedy actions" , "cluster" , cluster .Name , "actions" , actions )
83
83
return controllerruntime.Result {}, nil
84
84
}
85
85
0 commit comments