]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: allow sidecar containers to make use custom configs
authorJohn Mulligan <jmulligan@redhat.com>
Mon, 8 Dec 2025 20:26:57 +0000 (15:26 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 13 Feb 2026 16:38:11 +0000 (11:38 -0500)
Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/cephadm/cephadmlib/deployment_utils.py

index 908fa979f1a5603aa997f6b1f27b1fb493d230b5..0f344c915865fd1455537b36812e3e1f89b975b0 100644 (file)
@@ -1,17 +1,15 @@
 import os
 
-from .container_types import CephContainer
+from .container_types import CephContainer, BasicContainer
 from .context import CephadmContext
 from cephadmlib.context_getters import fetch_custom_config_files
 
 
-def to_deployment_container(
-    ctx: CephadmContext, ctr: CephContainer
-) -> CephContainer:
-    """Given a standard ceph container instance return a CephContainer
-    prepared for a deployment as a daemon, having the extra args and
-    custom configurations added.
-    NOTE: The `ctr` object is mutated before being returned.
+def enhance_container(ctx: CephadmContext, ctr: BasicContainer) -> None:
+    """Given a context and a basic container object, update the container
+    object such that it's arguments, entrypoint arguments, and volume mounts
+    'inherit' global "extra" -container args, -entrypoint args, and config
+    files in a common manner.
     """
     if 'extra_container_args' in ctx and ctx.extra_container_args:
         ctr.container_args.extend(ctx.extra_container_args)
@@ -32,4 +30,15 @@ def to_deployment_container(
                     os.path.basename(mount_path),
                 )
                 ctr.volume_mounts[file_path] = mount_path
+
+
+def to_deployment_container(
+    ctx: CephadmContext, ctr: CephContainer
+) -> CephContainer:
+    """Given a standard ceph container instance return a CephContainer
+    prepared for a deployment as a daemon, having the extra args and
+    custom configurations added.
+    NOTE: The `ctr` object is mutated before being returned.
+    """
+    enhance_container(ctx, ctr)
     return ctr