From f29c19430de6c9580387284bb85a281594bb76b7 Mon Sep 17 00:00:00 2001 From: Joseph Sawaya Date: Tue, 3 Aug 2021 13:31:08 -0400 Subject: [PATCH] mgr/rook: prevent creation of NFS clusters not in .nfs rados pool 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 --- src/pybind/mgr/rook/module.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/rook/module.py b/src/pybind/mgr/rook/module.py index 575e77273f68dd..c67f02085eed86 100644 --- a/src/pybind/mgr/rook/module.py +++ b/src/pybind/mgr/rook/module.py @@ -31,7 +31,7 @@ def names(self: Any, names: Any) -> None: 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 @@ -335,6 +335,8 @@ def describe_service(self, "cephnfses/") self.log.warning('CephNFS %s' % all_nfs) for nfs in all_nfs.get('items', []): + if nfs['spec']['rados']['pool'] != NFS_POOL_NAME: + continue nfs_name = nfs['metadata']['name'] svc = 'nfs.' + nfs_name if svc in spec: