From 9f753889edf436511d81a987157f9796860df980 Mon Sep 17 00:00:00 2001 From: Madhu Rajanna Date: Fri, 3 Nov 2023 09:47:24 +0100 Subject: [PATCH] rbd: remove deprecated rbdImageRequiresEncryption remove support for deprecated rbdImageRequiresEncryption case. Signed-off-by: Madhu Rajanna --- internal/rbd/encryption.go | 6 ------ internal/rbd/nodeserver.go | 17 ----------------- 2 files changed, 23 deletions(-) diff --git a/internal/rbd/encryption.go b/internal/rbd/encryption.go index 3d68e80c8..03ff15c52 100644 --- a/internal/rbd/encryption.go +++ b/internal/rbd/encryption.go @@ -48,12 +48,6 @@ const ( // with cryptsetup before updating the state to `rbdImageEncrypted`. rbdImageEncryptionPrepared = rbdEncryptionState("encryptionPrepared") - // rbdImageRequiresEncryption has been deprecated, it is used only for - // volumes that have been created with an old provisioner, were never - // attached/mounted and now get staged by a new node-plugin - // TODO: remove this backwards compatibility support. - rbdImageRequiresEncryption = rbdEncryptionState("requiresEncryption") - // image metadata key for encryption. encryptionMetaKey = "rbd.csi.ceph.com/encrypted" oldEncryptionMetaKey = ".rbd.csi.ceph.com/encrypted" diff --git a/internal/rbd/nodeserver.go b/internal/rbd/nodeserver.go index 25f51b35c..1009fd25f 100644 --- a/internal/rbd/nodeserver.go +++ b/internal/rbd/nodeserver.go @@ -1234,23 +1234,6 @@ func (ns *NodeServer) processEncryptedDevice( } switch { - case encrypted == rbdImageRequiresEncryption: - // If we get here, it means the image was created with a - // ceph-csi version that creates a passphrase for the encrypted - // device in NodeStage. New versions moved that to - // CreateVolume. - // Use the same setupEncryption() as CreateVolume does, and - // continue with the common process to crypt-format the device. - err = volOptions.setupBlockEncryption(ctx) - if err != nil { - log.ErrorLog(ctx, "failed to setup encryption for rbd"+ - "image %s: %v", imageSpec, err) - - return "", err - } - - // make sure we continue with the encrypting of the device - fallthrough case encrypted == rbdImageEncryptionPrepared: diskMounter := &mount.SafeFormatAndMount{Interface: ns.Mounter, Exec: utilexec.New()} // TODO: update this when adding support for static (pre-provisioned) PVs