]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add customize_container_mounts method to monitoring class
authorJohn Mulligan <jmulligan@redhat.com>
Sat, 4 Nov 2023 23:33:07 +0000 (19:33 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Sat, 11 Nov 2023 13:10:49 +0000 (08:10 -0500)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 48c50e779b86c37aa51c33fb76a2872a5d5de1e3..7bfbbeedb0a4eac5470b6c09f00a5a5c085213b5 100755 (executable)
@@ -810,7 +810,7 @@ class Monitoring(ContainerDaemonForm):
                   '--path.rootfs=/rootfs']
         return r
 
-    def get_container_mounts(self, data_dir: str) -> Dict[str, str]:
+    def _get_container_mounts(self, data_dir: str) -> Dict[str, str]:
         ctx = self.ctx
         daemon_type = self.identity.daemon_type
         mounts: Dict[str, str] = {}
@@ -853,6 +853,12 @@ class Monitoring(ContainerDaemonForm):
             ] = '/etc/alertmanager:Z'
         return mounts
 
+    def customize_container_mounts(
+        self, ctx: CephadmContext, mounts: Dict[str, str]
+    ) -> None:
+        data_dir = self.identity.data_dir(ctx.data_dir)
+        mounts.update(self._get_container_mounts(data_dir))
+
 ##################################
 
 
@@ -2700,9 +2706,8 @@ def get_container_mounts(
         mounts = Ceph.get_ceph_mounts(ctx, ident, no_config=no_config)
 
     if daemon_type in Monitoring.components:
-        data_dir = ident.data_dir(ctx.data_dir)
         monitoring = Monitoring.create(ctx, ident)
-        mounts.update(monitoring.get_container_mounts(data_dir))
+        monitoring.customize_container_mounts(ctx, mounts)
 
     if daemon_type == NFSGanesha.daemon_type:
         nfs_ganesha = NFSGanesha.create(ctx, ident)