From 5bc8b8d80be94e319c70cbb64b2dce9d1f8a660e Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sun, 5 Nov 2023 07:45:26 -0500 Subject: [PATCH] cephadm: add more ContainerDeamonForm methods to the nvmeof class Add method customize_container_args to the nvmeof daemon type class. Use that method in the get_container function. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 6e34834535df..ba2dc68bdd0b 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -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: -- 2.47.3