mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-23 23:00:19 +00:00
rbd: return crypt error for the rpc return
At present we return the volume connect error if the clone
from snapshot fails when rbdvolume is encrypted, which is incorrect.
This patch correctly return the failed copy encryption error to the
caller
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
(cherry picked from commit 798437d0c4
)
This commit is contained in:
parent
76fb7f6441
commit
1367cb445f
@ -811,13 +811,9 @@ func cloneFromSnapshot(ctx context.Context, rbdVol *rbdVolume, rbdSnap *rbdSnaps
|
|||||||
if rbdVol.isEncrypted() {
|
if rbdVol.isEncrypted() {
|
||||||
// FIXME: vol.VolID should be different from rbdVol.VolID
|
// FIXME: vol.VolID should be different from rbdVol.VolID
|
||||||
vol.VolID = rbdVol.VolID
|
vol.VolID = rbdVol.VolID
|
||||||
cryptErr := rbdVol.copyEncryptionConfig(&vol.rbdImage)
|
err = rbdVol.copyEncryptionConfig(&vol.rbdImage)
|
||||||
if cryptErr != nil {
|
if err != nil {
|
||||||
util.WarningLog(ctx, "failed copy encryption "+
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
"config for %q: %v", vol.String(),
|
|
||||||
rbdSnap.RequestName, cryptErr)
|
|
||||||
return nil, status.Errorf(codes.Internal,
|
|
||||||
err.Error())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user