cephfs: handle invalid error in fs resize

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:
Madhu Rajanna 2020-11-30 15:47:48 +05:30 committed by mergify[bot]
parent 2232067e99
commit 66eb3b7525

View File

@ -194,8 +194,9 @@ func (vo *volumeOptions) resizeVolume(ctx context.Context, volID volumeID, bytes
clusterAdditionalInfo[vo.ClusterID].resizeSupported = true
return nil
}
var invalid fsAdmin.NotImplementedError
// In case the error is other than invalid command return error to the caller.
if !strings.Contains(err.Error(), invalidCommand) {
if !errors.As(err, &invalid) {
util.ErrorLog(ctx, "failed to resize subvolume %s in fs %s: %s", string(volID), vo.FsName, err)
return err
}