]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: add more ContainerDeamonForm methods to the nvmeof class
authorJohn Mulligan <jmulligan@redhat.com>
Sun, 5 Nov 2023 12:45:26 +0000 (07:45 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 14 Nov 2023 21:05:48 +0000 (16:05 -0500)
Add method customize_container_args to the nvmeof daemon type class. Use
that method in the get_container function.

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

index 6e34834535df5837027c9d59e610414f73c79274..ba2dc68bdd0b03d87f6cecafe380f725bef454f0 100755 (executable)
@@ -1433,6 +1433,13 @@ class CephNvmeof(ContainerDaemonForm):
     ) -> Tuple[Optional[str], Optional[str]]:
         return get_config_and_keyring(ctx)
 
+    def customize_container_args(
+        self, ctx: CephadmContext, args: List[str]
+    ) -> None:
+        args.extend(['--ulimit', 'memlock=-1:-1'])
+        args.extend(['--ulimit', 'nofile=10240'])
+        args.extend(['--cap-add=SYS_ADMIN', '--cap-add=CAP_SYS_NICE'])
+
 
 ##################################
 
@@ -2903,10 +2910,8 @@ def get_container(
         container_args.extend(['--cap-add=NET_ADMIN', '--cap-add=NET_RAW'])
         mounts = get_container_mounts(ctx, ident)
     elif daemon_type == CephNvmeof.daemon_type:
-        name = ident.daemon_name
-        container_args.extend(['--ulimit', 'memlock=-1:-1'])
-        container_args.extend(['--ulimit', 'nofile=10240'])
-        container_args.extend(['--cap-add=SYS_ADMIN', '--cap-add=CAP_SYS_NICE'])
+        nvmeof = CephNvmeof.create(ctx, ident)
+        nvmeof.customize_container_args(ctx, container_args)
         binds = get_container_binds(ctx, ident)
         mounts = get_container_mounts(ctx, ident)
     elif daemon_type == CephIscsi.daemon_type: