From: Guillaume Abrioux Date: Wed, 16 Sep 2020 08:50:50 +0000 (+0200) Subject: cephadm: filter dangling images in get_last_local_ceph_image() X-Git-Tag: v15.2.9~122^2~44^2~22 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=abba11b85d05552a9e0b30b41d3a6a8f62fbf2ab;p=ceph.git cephadm: filter dangling images in get_last_local_ceph_image() if `podman images --filter label=ceph=True --format {{.Repository}} {{.Tag}}` returns something like following: ``` docker.io/ceph/ceph v15 ``` it will end up throwing an error: ``` r = args.func() File "./cephadm", line 1147, in _infer_fsid return func() File "./cephadm", line 1184, in _infer_config return func() File "./cephadm", line 1230, in _infer_image return func() File "./cephadm", line 3283, in command_shell make_log_dir(args.fsid) File "./cephadm", line 1325, in make_log_dir uid, gid = extract_uid_gid() File "./cephadm", line 1913, in extract_uid_gid raise RuntimeError('uid/gid not found') RuntimeError: uid/gid not found ``` adding `--filter dangling=false` can help to avoid this. Signed-off-by: Guillaume Abrioux (cherry picked from commit 01880cebcd64bc83ea722217e2925ab2b6304c65) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 6d32fc9fee8b..e37ad7d69d81 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1257,6 +1257,7 @@ def get_last_local_ceph_image(): out, _, _ = call_throws( [container_path, 'images', '--filter', 'label=ceph=True', + '--filter', 'dangling=false', '--format', '{{.Repository}} {{.Tag}}']) for line in out.splitlines(): if len(line.split()) == 2: