rbd: support pvc-pvc clone with different sc & encryption

This commit makes modification so as to allow pvc-pvc clone
with different storageclass having different encryption
configs.
This commit also modifies `copyEncryptionConfig()` to
include a `isEncrypted()` check within the function.

Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
Rakshith R
2022-04-25 15:45:08 +05:30
committed by mergify[bot]
parent 2672fad90a
commit f1ccc4eced
5 changed files with 34 additions and 32 deletions

View File

@ -324,8 +324,8 @@ func (rv *rbdVolume) Exists(ctx context.Context, parentVol *rbdVolume) (bool, er
return false, err
}
if parentVol != nil && parentVol.isEncrypted() {
err = parentVol.copyEncryptionConfig(&rv.rbdImage, false)
if parentVol != nil {
err = parentVol.copyEncryptionConfig(&rv.rbdImage, true)
if err != nil {
log.ErrorLog(ctx, err.Error())