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 <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2020-11-30 15:40:50 +05:30 committed by mergify[bot]
parent a0283ef7f9
commit 2232067e99

View File

@ -85,7 +85,7 @@ func (vo *volumeOptions) getSubVolumeInfo(ctx context.Context, volID volumeID) (
info, err := fsa.SubVolumeInfo(vo.FsName, vo.SubvolumeGroup, string(volID)) info, err := fsa.SubVolumeInfo(vo.FsName, vo.SubvolumeGroup, string(volID))
if err != nil { if err != nil {
util.ErrorLog(ctx, "failed to get subvolume info for the vol %s: %s", string(volID), err) 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 return nil, ErrVolumeNotFound
} }
// In case the error is other than invalid command return error to the caller. // In case the error is other than invalid command return error to the caller.