From 05b8433b89c3583b6c921bd831af19c6de68ec88 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Tue, 15 Jun 2021 11:39:01 +0530 Subject: [PATCH] rbd: check stdErr for does not have a parent error actual error will be present in the stdErr not the error when we try to add a task to flatten the rbd image. This commits corrects the error checking when the image does not have a parent. Signed-off-by: Madhu Rajanna --- internal/rbd/rbd_util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 666002007..72643af87 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -471,6 +471,9 @@ func addRbdManagerTask(ctx context.Context, pOpts *rbdVolume, arg []string) (boo util.WarningLog(ctx, "uncaught error while scheduling a task (%v): %s", err, stderr) } } + if err != nil { + err = fmt.Errorf("%w. stdError:%s", err, stderr) + } return supported, err }