mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 10:33:35 +00:00
rbd: repair encryption config in case it is missing
It is possible that when a provisioner restarts after a snapshot was cloned, but before the newly restored image had its encryption metadata set, the new image is not marked as encrypted. This will prevent attaching/mounting the image, as the encryption key will not be fetched, or is not available in the DEKStore. By actively repairing the encryption configuration when needed, this problem should be addressed. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
1482105309
commit
b1d05a1840
@ -266,6 +266,11 @@ func (cs *ControllerServer) CreateVolume(ctx context.Context, req *csi.CreateVol
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = rbdSnap.repairEncryptionConfig(&rbdVol.rbdImage)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
return buildCreateVolumeResponse(req, rbdVol), nil
|
||||
|
Reference in New Issue
Block a user