From 2aba5e539465202b2f8462c17591bd5bb1032dcd Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Fri, 23 Jan 2026 14:00:59 -0500 Subject: [PATCH] cephadm: fix naming issue when using sidecars When extending a container with extra settings a sidecar or init container should take the custom settings from that of the primary container. So use the newly added parent_identity function (when available) to determine the correct identity to use. Signed-off-by: John Mulligan --- src/cephadm/cephadmlib/deployment_utils.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/cephadm/cephadmlib/deployment_utils.py b/src/cephadm/cephadmlib/deployment_utils.py index 0f344c91586..56c9bcfad7b 100644 --- a/src/cephadm/cephadmlib/deployment_utils.py +++ b/src/cephadm/cephadmlib/deployment_utils.py @@ -16,17 +16,21 @@ def enhance_container(ctx: CephadmContext, ctr: BasicContainer) -> None: if 'extra_entrypoint_args' in ctx and ctx.extra_entrypoint_args: ctr.args.extend(ctx.extra_entrypoint_args) ccfiles = fetch_custom_config_files(ctx) + assert ctr.identity + if parentfn := getattr(ctr.identity, 'parent_identity', None): + identity = parentfn() + else: + identity = ctr.identity if ccfiles: mandatory_keys = ['mount_path', 'content'] for conf in ccfiles: if all(k in conf for k in mandatory_keys): mount_path = conf['mount_path'] - assert ctr.identity file_path = os.path.join( ctx.data_dir, - ctr.identity.fsid, + identity.fsid, 'custom_config_files', - ctr.identity.daemon_name, + identity.daemon_name, os.path.basename(mount_path), ) ctr.volume_mounts[file_path] = mount_path -- 2.47.3