Skip to content

Commit 8b33db9

Browse files
Merge pull request #3760 from riendeau/ibmcloud-kms-v2
OCPBUGS-30968: ibmcloud KMS: remove breaking image check and enable KMS v2 support
2 parents cd4d4c6 + 8209cca commit 8b33db9

File tree

1 file changed

+15
-2
lines changed
  • control-plane-operator/controllers/hostedcontrolplane/kas/kms

1 file changed

+15
-2
lines changed

control-plane-operator/controllers/hostedcontrolplane/kas/kms/ibmcloud.go

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ type ibmCloudKMSProvider struct {
5050
}
5151

5252
func NewIBMCloudKMSProvider(ibmCloud *hyperv1.IBMCloudKMSSpec, kmsImage string) (*ibmCloudKMSProvider, error) {
53-
if ibmCloud == nil || len(ibmCloud.KeyList) == 0 || len(ibmCloud.Region) == 0 || len(kmsImage) == 0 {
53+
if ibmCloud == nil || len(ibmCloud.KeyList) == 0 || len(ibmCloud.Region) == 0 {
5454
return nil, fmt.Errorf("ibmcloud kms metadata not specified")
5555
}
5656
return &ibmCloudKMSProvider{
@@ -66,7 +66,19 @@ func (p *ibmCloudKMSProvider) GenerateKMSEncryptionConfig() (*v1.EncryptionConfi
6666
keys = append(keys, k)
6767
}
6868
sort.Ints(keys)
69-
var providerConfiguration []v1.ProviderConfiguration
69+
70+
// KMS v2 should be first in the list
71+
providerConfiguration := []v1.ProviderConfiguration{
72+
{
73+
KMS: &v1.KMSConfiguration{
74+
APIVersion: "v2",
75+
Name: fmt.Sprintf("%s%s", ibmKeyNamePrefix, "v2"),
76+
Endpoint: ibmCloudKMSUnixSocket,
77+
Timeout: &metav1.Duration{Duration: 35 * time.Second},
78+
},
79+
},
80+
}
81+
7082
// iterate in reverse because highest version key should be used for new secret encryption
7183
for i := len(keys) - 1; i >= 0; i-- {
7284
configEntry := v1.ProviderConfiguration{
@@ -312,5 +324,6 @@ func (p *ibmCloudKMSProvider) ApplyKMSConfig(podSpec *corev1.PodSpec) error {
312324
}
313325
container.VolumeMounts = append(container.VolumeMounts,
314326
ibmCloudKMSVolumeMounts.ContainerMounts(KasMainContainerName)...)
327+
container.Args = append(container.Args, "--encryption-provider-config-automatic-reload=false")
315328
return nil
316329
}

0 commit comments

Comments
 (0)