Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <[email protected]>
  • Loading branch information
rewantsoni committed Oct 3, 2024
1 parent 955992b commit 18f2911
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/controller/csiaddons/csiaddonsnode_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: %w", driverName, err)
}

for _, cap := range conn.Capabilities {
Expand Down

0 comments on commit 18f2911

Please sign in to comment.