From 05d944c124168beb5709fc09f960bd6816d0b5bd 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 df5c3732b..46a1b3e9c 100644 --- a/internal/csi-addons/rbd/replication.go +++ b/internal/csi-addons/rbd/replication.go @@ -919,6 +919,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) }