From: John Mulligan Date: Fri, 23 Jan 2026 19:00:59 +0000 (-0500) Subject: cephadm: fix naming issue when using sidecars X-Git-Tag: testing/wip-vshankar-testing-20260222.101816~7^2~13 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2aba5e539465202b2f8462c17591bd5bb1032dcd;p=ceph-ci.git 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 --- 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