From 66eb3b7525f45b33bc91ebb2e8f5c870a61339da Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Mon, 30 Nov 2020 15:47:48 +0530 Subject: [PATCH] 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 --- internal/cephfs/volume.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/cephfs/volume.go b/internal/cephfs/volume.go index 9ddfb40b1..e3944add4 100644 --- a/internal/cephfs/volume.go +++ b/internal/cephfs/volume.go @@ -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 }