]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: fix naming issue when using sidecars
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 23 Jan 2026 19:00:59 +0000 (14:00 -0500)
committerJohn Mulligan <jmulligan@redhat.com>
Fri, 13 Feb 2026 16:38:12 +0000 (11:38 -0500)
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 <jmulligan@redhat.com>
src/cephadm/cephadmlib/deployment_utils.py

index 0f344c915865fd1455537b36812e3e1f89b975b0..56c9bcfad7b0e524986337f294680c2195d2ee72 100644 (file)
@@ -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