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:
Niels de Vos
2021-03-19 16:21:48 +01:00
committed by mergify[bot]
parent 9317e2afb4
commit eea97ca014
10 changed files with 38 additions and 46 deletions

View File

@ -58,11 +58,11 @@ func TestKMSWorkflow(t *testing.T) {
kms, err := GetKMS("tenant", defaultKMSType, secrets)
assert.NoError(t, err)
require.NotNil(t, kms)
assert.Equal(t, defaultKMSType, kms.GetID())
ve, err := NewVolumeEncryption(kms)
ve, err := NewVolumeEncryption("", kms)
assert.NoError(t, err)
require.NotNil(t, ve)
assert.Equal(t, defaultKMSType, ve.GetID())
volumeID := "volume-id"