]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: don't add --publish options to clustered instances
authorJohn Mulligan <jmulligan@redhat.com>
Thu, 12 Jun 2025 18:58:18 +0000 (14:58 -0400)
committerAdam King <adking@redhat.com>
Wed, 9 Jul 2025 15:52:24 +0000 (11:52 -0400)
Clustered instances use host networking (for reasons) and nothing
benefits from having --publish options in the container cli
doing nothing and possibly being misleading (as there could be
way more ports bound than the container runtime shows).

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

src/cephadm/cephadmlib/daemons/smb.py

index de2356c21d9d19768b0f0cb560205f8aa4d65f94..891e01e112a9b384cb8a90896df692a8b96c67a2 100644 (file)
@@ -225,11 +225,17 @@ class SMBDContainer(SambaContainerCommon):
 
     def container_args(self) -> List[str]:
         cargs = []
-        if self.cfg.smb_port:
-            cargs.append(f'--publish={self.cfg.smb_port}:{Ports.SMB.value}')
-        if self.cfg.metrics_port:
-            metrics_port = self.cfg.metrics_port
-            cargs.append(f'--publish={metrics_port}:{metrics_port}')
+        if not self.cfg.clustered:
+            # if we are not clustered we use container networking (vs. host
+            # networking) and need to publish ports via podman/docker.
+            # All published ports happen at the primary container.
+            if self.cfg.smb_port:
+                cargs.append(
+                    f'--publish={self.cfg.smb_port}:{Ports.SMB.value}'
+                )
+            if self.cfg.metrics_port:
+                metrics_port = self.cfg.metrics_port
+                cargs.append(f'--publish={metrics_port}:{metrics_port}')
         cargs.extend(_container_dns_args(self.cfg))
         return cargs