mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
cephfs: handle invalid error in subvolume info
go ceph returns NotImplementedError for invalid commands,cephcsi is using errors.As to find out the error. Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
parent
66eb3b7525
commit
1ba160afdb
@ -88,8 +88,9 @@ func (vo *volumeOptions) getSubVolumeInfo(ctx context.Context, volID volumeID) (
|
|||||||
if errors.Is(err, rados.ErrNotFound) {
|
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 invalid command return error to the caller.
|
||||||
if !strings.Contains(err.Error(), invalidCommand) {
|
var invalid fsAdmin.NotImplementedError
|
||||||
|
if errors.As(err, &invalid) {
|
||||||
return nil, ErrInvalidCommand
|
return nil, ErrInvalidCommand
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user