]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/nfs: take --ingress argument to 'nfs cluster create'
authorSage Weil <sage@newdream.net>
Thu, 6 May 2021 22:47:27 +0000 (18:47 -0400)
committerSage Weil <sage@newdream.net>
Tue, 25 May 2021 14:15:45 +0000 (10:15 -0400)
It is likely that the rook/k8s variation of ingress will not take a
virtual_ip argument.  We want to make sure that ingress yes/no can be
specified independent of the virtual_ip.

Signed-off-by: Sage Weil <sage@newdream.net>
src/pybind/mgr/nfs/module.py

index 8d26f07e1935e1b62b28da389f90ad8b9ddd5bb9..164c9f133aa22b2308284505e066bf2f6b8b380c 100644 (file)
@@ -1,3 +1,4 @@
+import errno
 import logging
 import threading
 from typing import Tuple, Optional, List
@@ -66,8 +67,15 @@ class Module(orchestrator.OrchestratorClientMixin, MgrModule):
     def _cmd_nfs_cluster_create(self,
                                 clusterid: str,
                                 placement: Optional[str]=None,
+                                ingress: Optional[bool]=None,
                                 virtual_ip: Optional[str]=None) -> Tuple[int, str, str]:
         """Create an NFS Cluster"""
+        if virtual_ip and not ingress:
+            return (-errno.EINVAL, '',
+                    '--virtual-ip can only be provided with --ingress')
+        if ingress and not virtual_ip:
+            return (-errno.EINVAL, '',
+                    '--ingress current requires --virtual-ip')
         return self.nfs.create_nfs_cluster(cluster_id=clusterid, placement=placement,
                                            virtual_ip=virtual_ip)