]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add more ContainerDeamonForm methods to the ceph exporter class
authorJohn Mulligan <jmulligan@redhat.com>
Sun, 5 Nov 2023 13:01:41 +0000 (08:01 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 14 Nov 2023 21:05:48 +0000 (16:05 -0500)
Add methods customize_process_args & default_entrypoint to the ceph
exporter daemon type class. Use those methods in the get_container
function.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadm.py

index c82e53f0b8475def39a917db291a5489bd98e3c2..7e9065ac29f7369380d3206e285e2939a122a0d9 100755 (executable)
@@ -1525,6 +1525,16 @@ class CephExporter(ContainerDaemonForm):
         cm = Ceph.get_ceph_mounts(ctx, self.identity)
         mounts.update(cm)
 
+    def customize_process_args(
+        self, ctx: CephadmContext, args: List[str]
+    ) -> None:
+        name = 'client.ceph-exporter.%s' % self.identity.daemon_id
+        args.extend(['-n', name, '-f'])
+        args.extend(self.get_daemon_args())
+
+    def default_entrypoint(self) -> str:
+        return self.entrypoint
+
 
 ##################################
 
@@ -2916,11 +2926,9 @@ def get_container(
         d_args.extend(nfs_ganesha.get_daemon_args())
         mounts = get_container_mounts(ctx, ident)
     elif daemon_type == CephExporter.daemon_type:
-        entrypoint = CephExporter.entrypoint
-        name = 'client.ceph-exporter.%s' % ident.daemon_id
-        ceph_args = ['-n', name, '-f']
-        ceph_exporter = CephExporter.init(ctx, ident.fsid, ident.daemon_id)
-        d_args.extend(ceph_exporter.get_daemon_args())
+        ceph_exporter = CephExporter.create(ctx, ident)
+        entrypoint = ceph_exporter.default_entrypoint()
+        ceph_exporter.customize_process_args(ctx, d_args)
     elif daemon_type == HAproxy.daemon_type:
         haproxy = HAproxy.create(ctx, ident)
         haproxy.customize_container_args(ctx, container_args)