From 9530807179b0d015c6c5e0c9d362f4c3b12451ff Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Thu, 10 Dec 2020 13:52:58 +0530 Subject: [PATCH] ceph: remove 'ganesha-' from nfs-ganesha config object name PR[1] in volume nfs plugin will remove it too. Since it can cause inconsistencies. This change will not affect exports created using dashboard. As it looks for ganesha config object just by 'conf-' [2]. Exports cannot be created by using volume/nfs plugin in Octopus version. Because the ceph rook module is broken. [1] https://github.com/ceph/ceph/pull/38510 [2] https://github.com/ceph/ceph/blob/octopus/src/pybind/mgr/dashboard/services/ganesha.py#L1111 Signed-off-by: Varsha Rao --- Documentation/ceph-nfs-crd.md | 2 +- pkg/operator/ceph/nfs/config.go | 6 +++++- pkg/operator/ceph/nfs/controller_test.go | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Documentation/ceph-nfs-crd.md b/Documentation/ceph-nfs-crd.md index 87826f6ef..479cd0ab7 100644 --- a/Documentation/ceph-nfs-crd.md +++ b/Documentation/ceph-nfs-crd.md @@ -78,7 +78,7 @@ spec: All daemons within a cluster will share configuration with no exports defined, and that includes a RADOS object via: ```ini -%url rados:////conf-nfs.ganesha- +%url rados:////conf-nfs. ``` > **NOTE**: This format of nfs-ganesha config object name was introduced in Ceph Octopus Version. In older versions, each daemon has it's own config object and with the name as *conf-.*. The nodeid is a value automatically assigned internally by rook. Nodeids start with "a" and go through "z", at which point they become two letters ("aa" to "az"). diff --git a/pkg/operator/ceph/nfs/config.go b/pkg/operator/ceph/nfs/config.go index 37c0188d4..769115a81 100644 --- a/pkg/operator/ceph/nfs/config.go +++ b/pkg/operator/ceph/nfs/config.go @@ -49,8 +49,12 @@ func getNFSNodeID(n *cephv1.CephNFS, name string) string { } func getGaneshaConfigObject(n *cephv1.CephNFS, version cephver.CephVersion, name string) string { + /* Exports created with Dashboard will not be affected by change in config object name. + * As it looks for ganesha config object just by 'conf-'. Exports cannot be created by using + * volume/nfs plugin in Octopus version. Because the ceph rook module is broken. + */ if version.IsAtLeastOctopus() { - return fmt.Sprintf("conf-nfs.ganesha-%s", n.Name) + return fmt.Sprintf("conf-nfs.%s", n.Name) } return fmt.Sprintf("conf-%s", getNFSNodeID(n, name)) } diff --git a/pkg/operator/ceph/nfs/controller_test.go b/pkg/operator/ceph/nfs/controller_test.go index 256e95f3a..d03a1b1bb 100644 --- a/pkg/operator/ceph/nfs/controller_test.go +++ b/pkg/operator/ceph/nfs/controller_test.go @@ -264,7 +264,7 @@ func TestGetGaneshaConfigObject(t *testing.T) { }, } nodeid := "a" - expectedName := "conf-nfs.ganesha-my-nfs" + expectedName := "conf-nfs.my-nfs" res := getGaneshaConfigObject(cephNFS, cephver.CephVersion{Major: 16}, nodeid) logger.Infof("Config Object for Pacific is %s", res)