]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephadm: filter dangling images in get_last_local_ceph_image()
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Sep 2020 08:50:50 +0000 (10:50 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 16 Sep 2020 09:09:39 +0000 (11:09 +0200)
if `podman images --filter label=ceph=True --format {{.Repository}} {{.Tag}}`
returns something like following:

```
<none>                <none>
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 <gabrioux@redhat.com>
src/cephadm/cephadm

index f640037a548e862c6629aee451b6061b7073f73a..612628a6aefe6e10df169fdcfaf059292bec707c 100755 (executable)
@@ -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: