Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

util: address few TODO's #4226

Merged
merged 3 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,7 @@ endif
GO_PROJECT=github.com/ceph/ceph-csi

CEPH_VERSION ?= $(shell . $(CURDIR)/build.env ; echo $${CEPH_VERSION})
# TODO: ceph_preview tag may be removed with go-ceph 0.17.0
# TODO: ceph_ci_untested is added for subvolume metadata (go-ceph#691) and snapshot metadata management (go-ceph#698)
GO_TAGS_LIST ?= $(CEPH_VERSION) ceph_preview ceph_ci_untested ceph_pre_quincy
GO_TAGS_LIST ?= $(CEPH_VERSION)

# go build flags
LDFLAGS ?=
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ require (
github.com/aws/aws-sdk-go v1.46.4
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2
github.com/ceph/ceph-csi/api v0.0.0-00010101000000-000000000000
// TODO: API for managing subvolume metadata and snapshot metadata requires `ceph_ci_untested` build-tag
github.com/ceph/go-ceph v0.24.0
github.com/container-storage-interface/spec v1.9.0
github.com/csi-addons/replication-lib-utils v0.2.0
Expand Down
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
8 changes: 1 addition & 7 deletions internal/util/csiconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ const (
type ClusterInfo struct {
// ClusterID is used for unique identification
ClusterID string `json:"clusterID"`
// RadosNamespace is a rados namespace in the pool
RadosNamespace string `json:"radosNamespace"` // For backward compatibility. TODO: Remove this in 3.7.0
// Monitors is monitor list for corresponding cluster ID
Monitors []string `json:"monitors"`
// CephFS contains CephFS specific options
Expand Down Expand Up @@ -130,11 +128,7 @@ func GetRadosNamespace(pathToConfig, clusterID string) (string, error) {
return "", err
}

if cluster.RBD.RadosNamespace != "" {
return cluster.RBD.RadosNamespace, nil
}

return cluster.RadosNamespace, nil
return cluster.RBD.RadosNamespace, nil
}

// CephFSSubvolumeGroup returns the subvolumeGroup for CephFS volumes. If not set, it returns the default value "csi".
Expand Down