]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add customize_container_mounts method to nvmeof class
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 20 Oct 2023 19:00:25 +0000 (15:00 -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 88f26e2abff2f1f9ff284d7fc3a3ca0a633f579a..fe67904d800f142c430664e26dad68e79fae328f 100755 (executable)
@@ -1298,7 +1298,7 @@ class CephNvmeof(ContainerDaemonForm):
         return DaemonIdentity(self.fsid, self.daemon_type, self.daemon_id)
 
     @staticmethod
-    def get_container_mounts(data_dir: str) -> Dict[str, str]:
+    def _get_container_mounts(data_dir: str) -> Dict[str, str]:
         mounts = dict()
         mounts[os.path.join(data_dir, 'config')] = '/etc/ceph/ceph.conf:z'
         mounts[os.path.join(data_dir, 'keyring')] = '/etc/ceph/keyring:z'
@@ -1308,6 +1308,12 @@ class CephNvmeof(ContainerDaemonForm):
         mounts['/dev/vfio/vfio'] = '/dev/vfio/vfio'
         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))
+
     def customize_container_binds(
         self, ctx: CephadmContext, binds: List[List[str]]
     ) -> None:
@@ -2690,8 +2696,8 @@ def get_container_mounts(
         mounts.update(HAproxy.get_container_mounts(data_dir))
 
     if daemon_type == CephNvmeof.daemon_type:
-        data_dir = ident.data_dir(ctx.data_dir)
-        mounts.update(CephNvmeof.get_container_mounts(data_dir))
+        nvmeof = CephNvmeof.create(ctx, ident)
+        nvmeof.customize_container_mounts(ctx, mounts)
 
     if daemon_type == CephIscsi.daemon_type:
         iscsi = CephIscsi.create(ctx, ident)