Skip to content

Commit

Permalink
improve logging
Browse files Browse the repository at this point in the history
Signed-off-by: Rewant Soni <resoni@redhat.com>
  • Loading branch information
rewantsoni authored and mergify[bot] committed Oct 7, 2024
1 parent 4371d89 commit 7b4049d
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 7b4049d

Please sign in to comment.