]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: propagate smbmetrics image via config_blobs
authorShachar Sharon <ssharon@redhat.com>
Thu, 8 Aug 2024 05:55:05 +0000 (08:55 +0300)
committerShachar Sharon <ssharon@redhat.com>
Fri, 30 Aug 2024 09:02:55 +0000 (12:02 +0300)
Current code assumes single image for each daemon-service. However,
Samba's metrics-exporter requires different image then the one used by
main samba server. Use the auxiliary 'config_blobs' map to propagate
the metrics image downwards to samba-service, plus metrics port number.

Signed-off-by: Shachar Sharon <ssharon@redhat.com>
src/pybind/mgr/cephadm/services/smb.py
src/pybind/mgr/cephadm/tests/test_services.py

index da75136cdfb83bc09114b10d52c93ef452d5f984..dabc202a024bd3a19dbaf4d0891d79af5f399e81 100644 (file)
@@ -16,6 +16,7 @@ logger = logging.getLogger(__name__)
 
 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:
@@ -79,6 +80,11 @@ class SMBService(CephService):
                 smb_spec, daemon_spec.daemon_id, ceph_users
             )
         )
+        config_blobs['metrics_image'] = (
+            self.mgr.container_image_samba_metrics
+        )
+        config_blobs['metrics_port'] = SMBService.DEFAULT_EXPORTER_PORT
+
         logger.debug('smb generate_config: %r', config_blobs)
         self._configure_cluster_meta(smb_spec, daemon_spec)
         return config_blobs, []
index 7cc6511025be457359943148e58f296ba04cd452..b3be014a0a662eba1cc7c414edfab8fda8db93d4 100644 (file)
@@ -3175,6 +3175,8 @@ class TestSMB:
                 'config': '',
                 '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,
             },
         }
         with with_host(cephadm_module, 'hostx'):
@@ -3245,6 +3247,8 @@ class TestSMB:
                     '[client.smb.fs.fs2.share3]\nkey = None\n'
                 ),
                 'config_auth_entity': 'client.smb.config.tango.briskly',
+                'metrics_image': 'quay.io/samba.org/samba-metrics:latest',
+                'metrics_port': 9922,
             },
         }
         with with_host(cephadm_module, 'hostx'):