rbd: copyEncryptionConfig in doSnapshotClone()

Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
Niels de Vos 2021-03-31 15:22:26 +02:00 committed by mergify[bot]
parent fd5f4dbafd
commit bea9d56117

View File

@ -928,6 +928,16 @@ func (cs *ControllerServer) doSnapshotClone(ctx context.Context, parentVol *rbdV
} }
}() }()
if parentVol.isEncrypted() {
cryptErr := parentVol.copyEncryptionConfig(&cloneRbd.rbdImage)
if cryptErr != nil {
util.WarningLog(ctx, "failed copy encryption "+
"config for %q: %v", cloneRbd.String(), cryptErr)
return ready, nil, status.Errorf(codes.Internal,
err.Error())
}
}
err = cloneRbd.createSnapshot(ctx, rbdSnap) err = cloneRbd.createSnapshot(ctx, rbdSnap)
if err != nil { if err != nil {
// update rbd image name for logging // update rbd image name for logging