]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: add more ContainerDeamonForm methods to the nfs class
authorJohn Mulligan <jmulligan@redhat.com>
Sun, 5 Nov 2023 13:09:10 +0000 (08:09 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Tue, 14 Nov 2023 21:05:48 +0000 (16:05 -0500)
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 <jmulligan@redhat.com>
src/cephadm/cephadm.py

index 7e9065ac29f7369380d3206e285e2939a122a0d9..171d2a1c928e68878584c77a32770d9136050a47 100755 (executable)
@@ -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)