mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-12-18 02:50:30 +00:00
rbd: move deletion of DEK to deleteImage()
The ControllerServer should not need to care about support for encryption, ideally it is transparantly handled by the rbdVolume type and its internal API. Deleting the DEK was one of the last remainders that was explicitly done inside the ControllerServer. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
parent
151d066938
commit
99da92cfd7
@ -690,12 +690,6 @@ func (cs *ControllerServer) DeleteVolume(ctx context.Context, req *csi.DeleteVol
|
||||
return nil, status.Error(codes.Internal, err.Error())
|
||||
}
|
||||
|
||||
if rbdVol.isEncrypted() {
|
||||
if err = rbdVol.encryption.RemoveDEK(rbdVol.VolID); err != nil {
|
||||
util.WarningLog(ctx, "failed to clean the passphrase for volume %s: %s", rbdVol.VolID, err)
|
||||
}
|
||||
}
|
||||
|
||||
return &csi.DeleteVolumeResponse{}, nil
|
||||
}
|
||||
|
||||
|
@ -475,6 +475,12 @@ func deleteImage(ctx context.Context, pOpts *rbdVolume, cr *util.Credentials) er
|
||||
|
||||
util.DebugLog(ctx, "rbd: delete %s using mon %s, pool %s", image, pOpts.Monitors, pOpts.Pool)
|
||||
|
||||
if pOpts.isEncrypted() {
|
||||
if err = pOpts.encryption.RemoveDEK(pOpts.VolID); err != nil {
|
||||
util.WarningLog(ctx, "failed to clean the passphrase for volume %s: %s", pOpts.VolID, err)
|
||||
}
|
||||
}
|
||||
|
||||
err = pOpts.openIoctx()
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user