Skip to content

The list of application images is empty #7430

@stephdl

Description

@stephdl

Pull Request Description

When an untagged (dangling) image is present on the system, the status page fails to list container images. This is due to the template attempting to access the first element of .Names without checking if the list is empty, which causes a runtime error. As a result, the entire image listing is skipped, and users do not see any images in the status output.

This is true for rootfull and rootless container images

Steps to reproduce

  • Install sogo and go to the status page, the images are listed, then create some untagged images
  • Build an image without a tag: podman build -f Dockerfile .
runagent -m sogo1
# Step 1: Build an image without a tag
podman build -f Dockerfile - <<EOF
FROM alpine
RUN echo "version 1" > /version.txt
EOF

# Step 2: Build again without a tag (overwrites previous)
podman build -f Dockerfile - <<EOF
FROM alpine
RUN echo "version 2" > /version.txt
EOF

# Step 3: List dangling images
podman images --filter dangling=true

go to the sogo status page, the images are not listed anymore

Expected behavior

All images, except untagged (dangling) ones, should be listed by get-status. Ffor transparency and cleanup purposes, we could list them also

Actual behavior

Untagged images are silently ignored due to direct indexing into .Names[0], which fails to list the image and exit (due to try/exception -> pass)

Acknowledgements

thank @mrmarkuz

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifiedAll test cases were verified successfully

    Type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions