rbd: change the keyprotect metadata name to ibmkeyprotect

To be consistent with other components and also to explictly
state it belong to `ibm keyprotect` service introducing this
change

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
(cherry picked from commit f822600689)
This commit is contained in:
Humble Chirammal
2022-01-24 14:39:31 +05:30
committed by mergify[bot]
parent bf5553971d
commit 014ab47a57
3 changed files with 22 additions and 6 deletions

View File

@ -23,14 +23,15 @@ import (
"fmt"
"github.com/ceph/ceph-csi/internal/util/k8s"
"github.com/ceph/ceph-csi/internal/util/log"
kp "github.com/IBM/keyprotect-go-client"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
kmsTypeKeyProtectMetadata = "kp-metadata"
kmsTypeKeyProtectMetadata = "ibmkeyprotect"
kmsTypeKeyProtectMetadataOld = "kp-metadata"
// keyProtectMetadataDefaultSecretsName is the default name of the Kubernetes Secret
// that contains the credentials to access the Key Protect KMS. The name of
// the Secret can be configured by setting the `IBM_KP_SECRET_NAME`
@ -62,6 +63,21 @@ var _ = RegisterProvider(Provider{
Initializer: initKeyProtectKMS,
})
// RegisterProvider for kmsTypeKeyProtectMetadataOld is kept here for backward compatibility.
var _ = RegisterProvider(Provider{
UniqueID: kmsTypeKeyProtectMetadataOld,
Initializer: initKeyProtectKMSOld,
})
// initKeyProtectKMSOld is the wrapper with a warning log.
func initKeyProtectKMSOld(args ProviderInitArgs) (EncryptionKMS, error) {
log.WarningLogMsg("%q is deprecated provider for IBM key Protect,"+
"use new provider name %q in the configuration, proceeding with %q",
kmsTypeKeyProtectMetadataOld, kmsTypeKeyProtectMetadata, kmsTypeKeyProtectMetadata)
return initKeyProtectKMS(args)
}
// KeyProtectKMS store the KMS connection information retrieved from the kms configmap.
type KeyProtectKMS struct {
// basic options to get the secret