From 229a0a2e71ac629f35d21aabb46bc2ed0b2f9436 Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Mon, 8 Dec 2025 15:26:57 -0500 Subject: [PATCH] cephadm: allow sidecar containers to make use custom configs Signed-off-by: John Mulligan --- src/cephadm/cephadmlib/deployment_utils.py | 25 +++++++++++++++------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/cephadm/cephadmlib/deployment_utils.py b/src/cephadm/cephadmlib/deployment_utils.py index 908fa979f1a..0f344c91586 100644 --- a/src/cephadm/cephadmlib/deployment_utils.py +++ b/src/cephadm/cephadmlib/deployment_utils.py @@ -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 -- 2.47.3