Skip to content

Commit

Permalink
rbd: remove deprecated rbdImageRequiresEncryption
Browse files Browse the repository at this point in the history
remove support for deprecated
rbdImageRequiresEncryption case.

Signed-off-by: Madhu Rajanna <[email protected]>
  • Loading branch information
Madhu-1 committed Nov 3, 2023
1 parent 8ee9d15 commit 02bf3eb
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 23 deletions.
6 changes: 0 additions & 6 deletions internal/rbd/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
17 changes: 0 additions & 17 deletions internal/rbd/nodeserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 02bf3eb

Please sign in to comment.