From 9ffe0771f7c719a6a6e8a564adfa573a4fce4d28 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Sun, 5 Nov 2023 08:09:10 -0500 Subject: [PATCH] cephadm: add more ContainerDeamonForm methods to the nfs class Add methods customize_{container_envs,process_args} & default_entrypoint to the nfs daemon type class. Use those methods in the get_container function. Signed-off-by: John Mulligan --- src/cephadm/cephadm.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/src/cephadm/cephadm.py b/src/cephadm/cephadm.py index 7e9065ac29f73..171d2a1c928e6 100755 --- a/src/cephadm/cephadm.py +++ b/src/cephadm/cephadm.py @@ -1051,6 +1051,19 @@ class NFSGanesha(ContainerDaemonForm): ) -> Tuple[Optional[str], Optional[str]]: return get_config_and_keyring(ctx) + def customize_container_envs( + self, ctx: CephadmContext, envs: List[str] + ) -> None: + envs.extend(self.get_container_envs()) + + def customize_process_args( + self, ctx: CephadmContext, args: List[str] + ) -> None: + args.extend(self.get_daemon_args()) + + def default_entrypoint(self) -> str: + return self.entrypoint + ################################## @@ -2919,11 +2932,10 @@ def get_container( tracing = Tracing.create(ctx, ident) d_args.extend(tracing.get_daemon_args()) elif daemon_type == NFSGanesha.daemon_type: - entrypoint = NFSGanesha.entrypoint - name = ident.daemon_name - envs.extend(NFSGanesha.get_container_envs()) - nfs_ganesha = NFSGanesha.init(ctx, ident.fsid, ident.daemon_id) - d_args.extend(nfs_ganesha.get_daemon_args()) + nfs_ganesha = NFSGanesha.create(ctx, ident) + entrypoint = nfs_ganesha.default_entrypoint() + nfs_ganesha.customize_container_envs(ctx, envs) + nfs_ganesha.customize_process_args(ctx, d_args) mounts = get_container_mounts(ctx, ident) elif daemon_type == CephExporter.daemon_type: ceph_exporter = CephExporter.create(ctx, ident) -- 2.39.5