]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: emit warning if daemon's image is not to be used 59929/head
authorMatthew Vernon <mvernon@wikimedia.org>
Wed, 28 Aug 2024 15:37:46 +0000 (16:37 +0100)
committerAdam King <adking@redhat.com>
Mon, 23 Sep 2024 15:36:25 +0000 (11:36 -0400)
If an image is not specified, cephadm shell will use the image
corresponding to a Ceph daemon running on the host (and will log a
debug message to that effect).

However, it will only use that image if it appears in the output of:

podman images --filter label=ceph=True --filter dangling=false

This commit means that cephadm will emit a warning if the container
image it was going to use fails this check, so the operator has more
of a clue to what is going on.

Fixes: https://tracker.ceph.com/issues/67778
Signed-off-by: Matthew Vernon <mvernon@wikimedia.org>
(cherry picked from commit b863c93ef1a1ce85164584dd17c5e71441bc550f)

src/cephadm/cephadm.py

index 075e6dcedda89cdb02d5cd0dc92af52191b4a838..6854fa22b231063dd3bd3d37b0f2b1f75224599e 100755 (executable)
@@ -586,6 +586,8 @@ def infer_local_ceph_image(ctx: CephadmContext, container_path: str) -> Optional
             if digest and not digest.endswith('@'):
                 logger.info(f"Using ceph image with id '{image_id}' and tag '{tag}' created on {created_date}\n{digest}")
                 return digest
+    if container_info is not None:
+        logger.warning(f"Not using image '{container_info.image_id}' as it's not in list of non-dangling images with ceph=True label")
     return None