Skip to content

Commit

Permalink
mgr/rook: prevent creation of NFS clusters not in .nfs rados pool
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joseph Sawaya committed Sep 8, 2021
1 parent b99e768 commit f29c194
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/pybind/mgr/rook/module.py
Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit f29c194

Please sign in to comment.