]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/rook: prevent creation of NFS clusters not in .nfs rados pool
authorJoseph Sawaya <jsawaya@redhat.com>
Tue, 3 Aug 2021 17:31:08 +0000 (13:31 -0400)
committerJoseph Sawaya <jsawaya@redhat.com>
Wed, 10 Nov 2021 17:08:02 +0000 (12:08 -0500)
This commit prevents the creation of NFS clusters that don't use the
.nfs RADOS pool using ceph orch apply nfs.

Signed-off-by: Joseph Sawaya <jsawaya@redhat.com>
src/pybind/mgr/rook/module.py

index fb9b8355cef979d432f92971bfc714452f5436f7..028e801c224b5039bf67d75fd975097f25692cf8 100644 (file)
@@ -33,7 +33,7 @@ except ImportError:
     client = None
     config = None
 
-from mgr_module import MgrModule, Option
+from mgr_module import MgrModule, Option, NFS_POOL_NAME
 import orchestrator
 from orchestrator import handle_orch_error, OrchResult, raise_if_exception
 
@@ -349,6 +349,8 @@ class RookOrchestrator(MgrModule, orchestrator.Orchestrator):
             # CephNFSes
             all_nfs = self.rook_cluster.get_resource("cephnfses")
             for nfs in all_nfs:
+                if nfs['spec']['rados']['pool'] != NFS_POOL_NAME:
+                    continue
                 nfs_name = nfs['metadata']['name']
                 svc = 'nfs.' + nfs_name
                 if svc in spec: