From 2232067e994bf001a132e660fbb23ac5d02c6bfe Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 30 Nov 2020 15:40:50 +0530 Subject: [PATCH] cephfs: use rados.ErrNotFound in subvolume info go-ceph rados.ErrNotFound for not found errors,cephcsi need to check same for not found errors. Signed-off-by: Madhu Rajanna --- internal/cephfs/volume.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/cephfs/volume.go b/internal/cephfs/volume.go index c6a3e6da7..9ddfb40b1 100644 --- a/internal/cephfs/volume.go +++ b/internal/cephfs/volume.go @@ -85,7 +85,7 @@ func (vo *volumeOptions) getSubVolumeInfo(ctx context.Context, volID volumeID) ( info, err := fsa.SubVolumeInfo(vo.FsName, vo.SubvolumeGroup, string(volID)) if err != nil { util.ErrorLog(ctx, "failed to get subvolume info for the vol %s: %s", string(volID), err) - if strings.HasPrefix(err.Error(), volumeNotFound) { + if errors.Is(err, rados.ErrNotFound) { return nil, ErrVolumeNotFound } // In case the error is other than invalid command return error to the caller.