From c5eb80f6119780ef655dfd1106cdc3a0299d0602 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 (cherry picked from commit a5f6d89171168bcca50f36f7f709953f5265eb60) --- 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 e3e1d4365..059aefd4a 100644 --- a/internal/csi-addons/rbd/replication.go +++ b/internal/csi-addons/rbd/replication.go @@ -866,6 +866,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) }