mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 02:43:36 +00:00
cleanup: refactor functions to accept a context parameter
Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
@ -635,14 +635,14 @@ func (ri *rbdImage) deleteImage(ctx context.Context) error {
|
||||
|
||||
if ri.isBlockEncrypted() {
|
||||
log.DebugLog(ctx, "rbd: going to remove DEK for %q (block encryption)", ri)
|
||||
if err = ri.blockEncryption.RemoveDEK(ri.VolID); err != nil {
|
||||
if err = ri.blockEncryption.RemoveDEK(ctx, ri.VolID); err != nil {
|
||||
log.WarningLog(ctx, "failed to clean the passphrase for volume %s (block encryption): %s", ri.VolID, err)
|
||||
}
|
||||
}
|
||||
|
||||
if ri.isFileEncrypted() {
|
||||
log.DebugLog(ctx, "rbd: going to remove DEK for %q (file encryption)", ri)
|
||||
if err = ri.fileEncryption.RemoveDEK(ri.VolID); err != nil {
|
||||
if err = ri.fileEncryption.RemoveDEK(ctx, ri.VolID); err != nil {
|
||||
log.WarningLog(ctx, "failed to clean the passphrase for volume %s (file encryption): %s", ri.VolID, err)
|
||||
}
|
||||
}
|
||||
@ -1032,7 +1032,7 @@ func genSnapFromSnapID(
|
||||
}
|
||||
}
|
||||
if imageAttributes.KmsID != "" && imageAttributes.EncryptionType == util.EncryptionTypeFile {
|
||||
err = rbdSnap.configureFileEncryption(imageAttributes.KmsID, secrets)
|
||||
err = rbdSnap.configureFileEncryption(ctx, imageAttributes.KmsID, secrets)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to configure file encryption for "+
|
||||
"%q: %w", rbdSnap, err)
|
||||
@ -1133,7 +1133,7 @@ func generateVolumeFromVolumeID(
|
||||
}
|
||||
}
|
||||
if imageAttributes.KmsID != "" && imageAttributes.EncryptionType == util.EncryptionTypeFile {
|
||||
err = rbdVol.configureFileEncryption(imageAttributes.KmsID, secrets)
|
||||
err = rbdVol.configureFileEncryption(ctx, imageAttributes.KmsID, secrets)
|
||||
if err != nil {
|
||||
return rbdVol, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user