mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 02:33:34 +00:00
util: move GetID() from EncryptionKMS to VolumeEncryption
There is no need for each EncryptionKMS to implement the same GetID() function. We have a VolumeEncryption type that is more suitable for keeping track of the KMS-ID that was used to get the configuration of the KMS. This does not change any metadata that is stored anywhere. Signed-off-by: Niels de Vos <ndevos@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
9317e2afb4
commit
eea97ca014
@ -208,7 +208,7 @@ func (ri *rbdImage) configureEncryption(kmsID string, credentials map[string]str
|
||||
return err
|
||||
}
|
||||
|
||||
ri.encryption, err = util.NewVolumeEncryption(kms)
|
||||
ri.encryption, err = util.NewVolumeEncryption(kmsID, kms)
|
||||
|
||||
// if the KMS can not store the DEK itself, we'll store it in the
|
||||
// metadata of the RBD image itself
|
||||
|
@ -234,7 +234,7 @@ func (rv *rbdVolume) Exists(ctx context.Context, parentVol *rbdVolume) (bool, er
|
||||
|
||||
kmsID := ""
|
||||
if rv.isEncrypted() {
|
||||
kmsID = rv.encryption.KMS.GetID()
|
||||
kmsID = rv.encryption.GetID()
|
||||
}
|
||||
|
||||
j, err := volJournal.Connect(rv.Monitors, rv.RadosNamespace, rv.conn.Creds)
|
||||
@ -411,7 +411,7 @@ func reserveVol(ctx context.Context, rbdVol *rbdVolume, rbdSnap *rbdSnapshot, cr
|
||||
|
||||
kmsID := ""
|
||||
if rbdVol.isEncrypted() {
|
||||
kmsID = rbdVol.encryption.KMS.GetID()
|
||||
kmsID = rbdVol.encryption.GetID()
|
||||
}
|
||||
|
||||
j, err := volJournal.Connect(rbdVol.Monitors, rbdVol.RadosNamespace, cr)
|
||||
|
Reference in New Issue
Block a user