From 4101b63e02f110a30f09a499e31b5ebaaa59cd0e Mon Sep 17 00:00:00 2001 From: yati1998 Date: Tue, 14 Jan 2025 18:39:27 +0530 Subject: [PATCH] rbd: add check to getVolumeReplicationInfo this commit adds a check to getVolumeReplicationInfo to include status not found error while getting the remote status. This helps the failover to be done even if remote site status is not found Signed-off-by: yati1998 --- internal/csi-addons/rbd/replication.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/csi-addons/rbd/replication.go b/internal/csi-addons/rbd/replication.go index 566b59cf7..366602d57 100644 --- a/internal/csi-addons/rbd/replication.go +++ b/internal/csi-addons/rbd/replication.go @@ -876,6 +876,10 @@ func (rs *ReplicationServer) GetVolumeReplicationInfo(ctx context.Context, if err != nil { log.ErrorLog(ctx, err.Error()) + if errors.Is(err, librbd.ErrNotExist) { + return nil, status.Errorf(codes.NotFound, "failed to get remote status: %v", err) + } + return nil, status.Errorf(codes.Internal, "failed to get remote status: %v", err) }