From 72be5a0f48c3838c0ffb3d505ac3f853955d8e34 Mon Sep 17 00:00:00 2001 From: Rewant Soni Date: Tue, 1 Oct 2024 14:37:45 +0530 Subject: [PATCH] improve logging Signed-off-by: Rewant Soni --- internal/controller/csiaddons/csiaddonsnode_controller.go | 4 ++-- .../replication.storage/volumereplication_controller.go | 2 +- internal/proto/encryptionkeyrotation.pb.go | 2 +- internal/proto/encryptionkeyrotation_grpc.pb.go | 2 +- internal/proto/networkfence.pb.go | 2 +- internal/proto/networkfence_grpc.pb.go | 2 +- internal/proto/reclaimspace.pb.go | 2 +- internal/proto/reclaimspace_grpc.pb.go | 2 +- internal/proto/replication.pb.go | 2 +- internal/proto/replication_grpc.pb.go | 2 +- internal/proto/volumegroup.pb.go | 2 +- internal/proto/volumegroup_grpc.pb.go | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-) diff --git a/internal/controller/csiaddons/csiaddonsnode_controller.go b/internal/controller/csiaddons/csiaddonsnode_controller.go index 9f141f359..d5f0f763e 100644 --- a/internal/controller/csiaddons/csiaddonsnode_controller.go +++ b/internal/controller/csiaddons/csiaddonsnode_controller.go @@ -101,7 +101,7 @@ func (r *CSIAddonsNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reques if !csiAddonsNode.DeletionTimestamp.IsZero() { // if deletion timestamp is set, the CSIAddonsNode is getting deleted, // delete connections and remove finalizer. - logger.Info("Deleting connection") + logger.Info("Deleting connection", "Key", key) r.ConnPool.Delete(key) err = r.removeFinalizer(ctx, &logger, csiAddonsNode) return ctrl.Result{}, err @@ -139,7 +139,7 @@ func (r *CSIAddonsNodeReconciler) Reconcile(ctx context.Context, req ctrl.Reques logger.Info("Successfully connected to sidecar") r.ConnPool.Put(key, newConn) - logger.Info("Added connection to connection pool") + logger.Info("Added connection to connection pool", "Key", key) csiAddonsNode.Status.State = csiaddonsv1alpha1.CSIAddonsNodeStateConnected csiAddonsNode.Status.Message = "Successfully established connection with sidecar" diff --git a/internal/controller/replication.storage/volumereplication_controller.go b/internal/controller/replication.storage/volumereplication_controller.go index 288d0c8ac..73b3787c1 100644 --- a/internal/controller/replication.storage/volumereplication_controller.go +++ b/internal/controller/replication.storage/volumereplication_controller.go @@ -510,7 +510,7 @@ func getInfoReconcileInterval(parameters map[string]string, logger logr.Logger) func (r *VolumeReplicationReconciler) getReplicationClient(ctx context.Context, driverName, dataSource string) (grpcClient.VolumeReplication, error) { conn, err := r.Connpool.GetLeaderByDriver(ctx, r.Client, driverName) if err != nil { - return nil, fmt.Errorf("no leader for the ControllerService of driver %q", driverName) + return nil, fmt.Errorf("no leader for the ControllerService of driver %q: %v", driverName, err) } for _, cap := range conn.Capabilities { diff --git a/internal/proto/encryptionkeyrotation.pb.go b/internal/proto/encryptionkeyrotation.pb.go index b901f0caa..d50904c6a 100644 --- a/internal/proto/encryptionkeyrotation.pb.go +++ b/internal/proto/encryptionkeyrotation.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.20.2 +// protoc v5.28.1 // source: encryptionkeyrotation.proto package proto diff --git a/internal/proto/encryptionkeyrotation_grpc.pb.go b/internal/proto/encryptionkeyrotation_grpc.pb.go index eeb6c5242..43cc9b30a 100644 --- a/internal/proto/encryptionkeyrotation_grpc.pb.go +++ b/internal/proto/encryptionkeyrotation_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.2 +// - protoc v5.28.1 // source: encryptionkeyrotation.proto package proto diff --git a/internal/proto/networkfence.pb.go b/internal/proto/networkfence.pb.go index e2b6d4a15..02aa7fcfd 100644 --- a/internal/proto/networkfence.pb.go +++ b/internal/proto/networkfence.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.20.2 +// protoc v5.28.1 // source: networkfence.proto package proto diff --git a/internal/proto/networkfence_grpc.pb.go b/internal/proto/networkfence_grpc.pb.go index 90699dc39..b103d7c9d 100644 --- a/internal/proto/networkfence_grpc.pb.go +++ b/internal/proto/networkfence_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.2 +// - protoc v5.28.1 // source: networkfence.proto package proto diff --git a/internal/proto/reclaimspace.pb.go b/internal/proto/reclaimspace.pb.go index 38abe046f..971d960ff 100644 --- a/internal/proto/reclaimspace.pb.go +++ b/internal/proto/reclaimspace.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.20.2 +// protoc v5.28.1 // source: reclaimspace.proto package proto diff --git a/internal/proto/reclaimspace_grpc.pb.go b/internal/proto/reclaimspace_grpc.pb.go index 4d6232930..6f97d3538 100644 --- a/internal/proto/reclaimspace_grpc.pb.go +++ b/internal/proto/reclaimspace_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.2 +// - protoc v5.28.1 // source: reclaimspace.proto package proto diff --git a/internal/proto/replication.pb.go b/internal/proto/replication.pb.go index 93ce58306..7e909abb0 100644 --- a/internal/proto/replication.pb.go +++ b/internal/proto/replication.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.20.2 +// protoc v5.28.1 // source: replication.proto package proto diff --git a/internal/proto/replication_grpc.pb.go b/internal/proto/replication_grpc.pb.go index eed00bf60..8a543bf0a 100644 --- a/internal/proto/replication_grpc.pb.go +++ b/internal/proto/replication_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.2 +// - protoc v5.28.1 // source: replication.proto package proto diff --git a/internal/proto/volumegroup.pb.go b/internal/proto/volumegroup.pb.go index 3c63799eb..be91ddf42 100644 --- a/internal/proto/volumegroup.pb.go +++ b/internal/proto/volumegroup.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.34.2 -// protoc v3.20.2 +// protoc v5.28.1 // source: volumegroup.proto package proto diff --git a/internal/proto/volumegroup_grpc.pb.go b/internal/proto/volumegroup_grpc.pb.go index bddf4f662..413d735b8 100644 --- a/internal/proto/volumegroup_grpc.pb.go +++ b/internal/proto/volumegroup_grpc.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-go-grpc. DO NOT EDIT. // versions: // - protoc-gen-go-grpc v1.5.1 -// - protoc v3.20.2 +// - protoc v5.28.1 // source: volumegroup.proto package proto