mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-10 00:10:20 +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) {
|
||||
return nil, ErrVolumeNotFound
|
||||
}
|
||||
// In case the error is other than invalid command return error to the caller.
|
||||
if !strings.Contains(err.Error(), invalidCommand) {
|
||||
// In case the error is invalid command return error to the caller.
|
||||
var invalid fsAdmin.NotImplementedError
|
||||
if errors.As(err, &invalid) {
|
||||
return nil, ErrInvalidCommand
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user