mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 11:00:25 +00:00
rbd: Fix error checking mistake in CreateVolume
deleteErr should be checked if it's nil instead of err Signed-off-by: Mehdy Khoshnoody <mehdy.khoshnoody@gmail.com>
This commit is contained in:
parent
ea3d9e941f
commit
fe384bccfe
@ -230,9 +230,9 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
|||||||
if rbdVol.Encrypted {
|
if rbdVol.Encrypted {
|
||||||
err = rbdVol.ensureEncryptionMetadataSet(rbdImageRequiresEncryption)
|
err = rbdVol.ensureEncryptionMetadataSet(rbdImageRequiresEncryption)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
klog.Errorf(util.Log(ctx, "failed to save encryption status, deleting image %s"),
|
klog.Errorf(util.Log(ctx, "failed to save encryption status, deleting image %s: %s"),
|
||||||
rbdVol.RbdImageName)
|
rbdVol.RbdImageName, err)
|
||||||
if deleteErr := deleteImage(ctx, rbdVol, cr); err != nil {
|
if deleteErr := deleteImage(ctx, rbdVol, cr); deleteErr != nil {
|
||||||
klog.Errorf(util.Log(ctx, "failed to delete rbd image: %s/%s with error: %v"),
|
klog.Errorf(util.Log(ctx, "failed to delete rbd image: %s/%s with error: %v"),
|
||||||
rbdVol.Pool, rbdVol.RbdImageName, deleteErr)
|
rbdVol.Pool, rbdVol.RbdImageName, deleteErr)
|
||||||
return nil, deleteErr
|
return nil, deleteErr
|
||||||
|
Loading…
Reference in New Issue
Block a user