Skip to content

Commit 3cc0605

Browse files
committed
cephadm: propagate smbmetrics image via config_blobs
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 <[email protected]>
1 parent bb6e68a commit 3cc0605

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
class SMBService(CephService):
1818
TYPE = 'smb'
19+
DEFAULT_EXPORTER_PORT = 9922
1920
smb_pool = '.smb' # minor layering violation. try to clean up later.
2021

2122
def config(self, spec: ServiceSpec) -> None:
@@ -79,6 +80,11 @@ def generate_config(
7980
smb_spec, daemon_spec.daemon_id, ceph_users
8081
)
8182
)
83+
config_blobs['metrics_image'] = (
84+
self.mgr.container_image_samba_metrics
85+
)
86+
config_blobs['metrics_port'] = SMBService.DEFAULT_EXPORTER_PORT
87+
8288
logger.debug('smb generate_config: %r', config_blobs)
8389
self._configure_cluster_meta(smb_spec, daemon_spec)
8490
return config_blobs, []

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3175,6 +3175,8 @@ def test_deploy_smb(
31753175
'config': '',
31763176
'keyring': '[client.smb.config.tango.briskly]\nkey = None\n',
31773177
'config_auth_entity': 'client.smb.config.tango.briskly',
3178+
'metrics_image': 'quay.io/samba.org/samba-metrics:latest',
3179+
'metrics_port': 9922,
31783180
},
31793181
}
31803182
with with_host(cephadm_module, 'hostx'):
@@ -3245,6 +3247,8 @@ def test_deploy_smb_join_dns(
32453247
'[client.smb.fs.fs2.share3]\nkey = None\n'
32463248
),
32473249
'config_auth_entity': 'client.smb.config.tango.briskly',
3250+
'metrics_image': 'quay.io/samba.org/samba-metrics:latest',
3251+
'metrics_port': 9922,
32483252
},
32493253
}
32503254
with with_host(cephadm_module, 'hostx'):

0 commit comments

Comments
 (0)