]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/smb: add a remote control configuration to cluster resource
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 2 Jul 2025 22:15:16 +0000 (18:15 -0400)
committerAdam King <adking@redhat.com>
Thu, 21 Aug 2025 18:13:55 +0000 (14:13 -0400)
Add the remote control component to a field of the cluster resource.
A remote control side car can be explicitly enabled or implicitly
enabled by specifying the tls creds.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 2698e050d861999433b7717d5822a2b5942f8504)

src/pybind/mgr/smb/resources.py

index 3b50017336d4be5686771681a3fa616b1898cf34..4fe7ad6b4d6888e8b77f6dd55218c5c96aee7c4d 100644 (file)
@@ -530,6 +530,8 @@ class Cluster(_RBase):
     # bind_addrs are used to restrict what IP addresses instances of this
     # cluster will use
     bind_addrs: Optional[List[ClusterBindIP]] = None
+    # configure a remote control sidecar server.
+    remote_control: Optional[RemoteControl] = None
 
     def validate(self) -> None:
         if not self.cluster_id:
@@ -576,6 +578,15 @@ class Cluster(_RBase):
     def clustering_mode(self) -> SMBClustering:
         return self.clustering if self.clustering else SMBClustering.DEFAULT
 
+    @property
+    def remote_control_is_enabled(self) -> bool:
+        """Return true if a remote control service should be enabled for this
+        cluster.
+        """
+        if not self.remote_control:
+            return False
+        return self.remote_control.is_enabled
+
     def is_clustered(self) -> bool:
         """Return true if smbd instance should use (CTDB) clustering."""
         if self.clustering_mode == SMBClustering.ALWAYS: