]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: update smb port management in smb.py
authorJohn Mulligan <jmulligan@redhat.com>
Wed, 11 Jun 2025 14:43:59 +0000 (10:43 -0400)
committerAdam King <adking@redhat.com>
Wed, 9 Jul 2025 15:52:24 +0000 (11:52 -0400)
Remove the hard coded default smbmetrics port, to help break any legacy
code that might be trying to use it.
Ensure that all customized port values get passed down to the cephadm
binary.

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

src/pybind/mgr/cephadm/services/smb.py
src/pybind/mgr/cephadm/tests/test_services.py

index 0b8c8cf569f9ec1f61f8df0179d5f9c630d8e933..ad63e7d94b88e65b529186ad5f516e753145cf55 100644 (file)
@@ -21,7 +21,6 @@ logger = logging.getLogger(__name__)
 @register_cephadm_service
 class SMBService(CephService):
     TYPE = 'smb'
-    DEFAULT_EXPORTER_PORT = 9922
     smb_pool = '.smb'  # minor layering violation. try to clean up later.
 
     def config(self, spec: ServiceSpec) -> None:
@@ -107,11 +106,11 @@ class SMBService(CephService):
         config_blobs['metrics_image'] = (
             self.mgr.container_image_samba_metrics
         )
-        config_blobs['metrics_port'] = SMBService.DEFAULT_EXPORTER_PORT
         if 'cephfs-proxy' in smb_spec.features:
             config_blobs['proxy_image'] = self.mgr.get_container_image(
                 '', force_ceph_image=True
             )
+        config_blobs['service_ports'] = smb_spec.service_ports()
 
         logger.debug('smb generate_config: %r', config_blobs)
         self._configure_cluster_meta(smb_spec, daemon_spec)
index cb1aa8bc1ae9c1e5ee970db20c7fdeb0a6a1bf75..34401fcd38ac74a813ed2a88f1012dba21d8ebfc 100644 (file)
@@ -3890,7 +3890,7 @@ class TestSMB:
                 'keyring': '[client.smb.config.tango.briskly]\nkey = None\n',
                 'config_auth_entity': 'client.smb.config.tango.briskly',
                 'metrics_image': 'quay.io/samba.org/samba-metrics:latest',
-                'metrics_port': 9922,
+                'service_ports': {'smb': 445, 'smbmetrics': 9922, 'ctdb': 4379},
             },
         }
         with with_host(cephadm_module, 'hostx'):
@@ -3965,7 +3965,7 @@ class TestSMB:
                 ),
                 'config_auth_entity': 'client.smb.config.tango.briskly',
                 'metrics_image': 'quay.io/samba.org/samba-metrics:latest',
-                'metrics_port': 9922,
+                'service_ports': {'smb': 445, 'smbmetrics': 9922, 'ctdb': 4379},
             },
         }
         with with_host(cephadm_module, 'hostx'):