mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-23 21:40:20 +00:00
rbd: setup encryption if rbdVol exits during CreateVol
This commit adds code to setup encryption on a rbdVol being repaired in a followup CreateVolume request. This is fixes a bug wherein encryption metadata may not have been set in previous request due to container restart. Fixes: #3402 Signed-off-by: Rakshith R <rar@redhat.com>
This commit is contained in:
parent
07e9dede2c
commit
8650538b78
@ -508,6 +508,15 @@ func (cs *ControllerServer) repairExistingVolume(ctx context.Context, req *csi.C
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
default:
|
||||
// setup encryption again to make sure everything is in place.
|
||||
if rbdVol.isBlockEncrypted() {
|
||||
err := rbdVol.setupBlockEncryption(ctx)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to setup encryption for image %s: %w", rbdVol, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set metadata on restart of provisioner pod when image exist
|
||||
|
Loading…
Reference in New Issue
Block a user