From 367eb9f7485f9d2a305343587844678027aa2d78 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Thu, 17 Jun 2021 12:08:21 +0530 Subject: [PATCH] rbd: correct return error for isCompatibleEncryption isCompatibleEncryption is used to validate the requested volume and the existing volume and the destination volume name wont be generated yet and logging the destination volume prints the empty image name with pool name. Signed-off-by: Madhu Rajanna --- internal/rbd/rbd_util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/rbd/rbd_util.go b/internal/rbd/rbd_util.go index 72643af87..039109950 100644 --- a/internal/rbd/rbd_util.go +++ b/internal/rbd/rbd_util.go @@ -1562,10 +1562,10 @@ func (rv *rbdVolume) getOrigSnapName(snapID uint64) (string, error) { func (ri *rbdImage) isCompatibleEncryption(dst *rbdImage) error { switch { case ri.isEncrypted() && !dst.isEncrypted(): - return fmt.Errorf("encrypted volume %q does not match unencrypted volume %q", ri, dst) + return fmt.Errorf("cannot create unencrypted volume from encrypted volume %q", ri) case !ri.isEncrypted() && dst.isEncrypted(): - return fmt.Errorf("unencrypted volume %q does not match encrypted volume %q", ri, dst) + return fmt.Errorf("cannot create encrypted volume from unencrypted volume %q", ri) } return nil