Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid event on image removal + missing untag event from REST API #15485

Closed
benoitf opened this issue Aug 25, 2022 · 3 comments · Fixed by #15510
Closed

invalid event on image removal + missing untag event from REST API #15485

benoitf opened this issue Aug 25, 2022 · 3 comments · Fixed by #15510
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related podman-desktop

Comments

@benoitf
Copy link
Contributor

benoitf commented Aug 25, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

Removing an image should send a delete event but I'm receiving a remove event

https://docs.docker.com/engine/api/v1.41/#tag/System/operation/SystemEvents
states:
Images report these events: delete, import, load, pull, push, save, tag, untag, and prune

Steps to reproduce the issue:

  1. pull an image with docker
$ docker pull httpd

track events in a separate terminal

$ curl --unix-socket /var/run/docker.sock http:/v1.41/events

remove the image

$ docker rmi a981c8992512

look at the events

{"status":"untag","id":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Type":"image","Action":"untag","Actor":{"ID":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Attributes":{"name":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825"}},"scope":"local","time":1661444877,"timeNano":1661444877274518985}
{"status":"untag","id":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Type":"image","Action":"untag","Actor":{"ID":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Attributes":{"name":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825"}},"scope":"local","time":1661444877,"timeNano":1661444877278753809}
{"status":"delete","id":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Type":"image","Action":"delete","Actor":{"ID":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Attributes":{"name":"sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825"}},"scope":"local","time":1661444877,"timeNano":1661444877436313927}

Now, try with podman

pull httpd image

$ podman pull httpd
Resolving "httpd" using unqualified-search registries (/etc/containers/registries.conf.d/999-podman-machine.conf)
Trying to pull docker.io/library/httpd:latest...
Getting image source signatures
Copying blob sha256:152876b0d24a5561415915c652dceeb3bcd5080dc24c3994e77343a81f64b9f1
Copying blob sha256:7a6db449b51b92eac5c81cdbd82917785343f1664b2be57b22337b0a40c5b29d
Copying blob sha256:b4effd428409f1da4dc8c896afb9818ef1ba24be5e7e5e3d86dea650ac3ed8bc
Copying blob sha256:6b29c2b62286e254216da297b4066a4bb79b918bc02811ba954bd7b8fd51360b
Copying blob sha256:c2123effa3fcb96c62bf4d891147aef09029d429321bfb4c6a535fa3ca7e13d6
Copying config sha256:a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825
Writing manifest to image destination
Storing signatures
a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825

Track events in a separate terminal

$ curl --unix-socket /Users/benoitf/.local/share/containers/podman/machine/podman-machine-default/podman.sock http:/v1.41/events

remove the image

$ podman rmi a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825

Untagged: docker.io/library/httpd:latest
Deleted: a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825

look at events

{"status":"remove","id":"a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Type":"image","Action":"remove","Actor":{"ID":"a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825","Attributes":{"containerExitCode":"0","image":"","name":"a981c8992512d65c9b450a9ecabb1cb9d35bb6b03f3640f86471032d5800d825"}},"scope":"local","time":1661444997,"timeNano":1661444997046721781,"HealthStatus":""}

we are missing the untag event and we receive a remove event instead of delete

Describe the results you received:

receive remove

Describe the results you expected:

expect untag + delete events

Additional information you deem important (e.g. issue happens only occasionally):

Output of podman version:

Client:       Podman Engine
Version:      4.2.0
API Version:  4.2.0
Go Version:   go1.18.5
Built:        Wed Aug 10 22:46:05 2022
OS/Arch:      darwin/amd64

Server:       Podman Engine
Version:      4.2.0
API Version:  4.2.0
Go Version:   go1.18.4
Built:        Thu Aug 11 16:42:17 2022
OS/Arch:      linux/amd64

Output of podman info:

(paste your output here)

Package info (e.g. output of rpm -q podman or apt list podman):

(paste your output here)

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes/No

Additional environment details (AWS, VirtualBox, physical, etc.):

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 25, 2022
@github-actions github-actions bot added the macos MacOS (OSX) related label Aug 25, 2022
@mheon mheon self-assigned this Aug 25, 2022
@mheon
Copy link
Member

mheon commented Aug 25, 2022

I'll get the misnamed event now. @vrothberg The missing untag event will need to go in libimage, right?

mheon added a commit to mheon/libpod that referenced this issue Aug 25, 2022
Change only the compat API, so we don't force a breaking change
on Libpod API users.

Partial fix for containers#15485

Signed-off-by: Matthew Heon <[email protected]>
@vrothberg
Copy link
Member

I'll get the misnamed event now. @vrothberg The missing untag event will need to go in libimage, right?

Yes, that needs to go into libimage. The Untag() method already sends these events but I think that image removal optimizes to directly remove the image when deleting by ID as done in the reproducer above.

vrothberg added a commit to vrothberg/common that referenced this issue Aug 26, 2022
As reported in containers/podman/issues/15485, Docker sends untag events
prior to removing the image.  Follow that example for compatibility
reasons.

Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member

Open a PR containers/common#1132

vrothberg added a commit to vrothberg/libpod that referenced this issue Aug 27, 2022
Emit untag events for each tag when removing an image.

Fixes: containers#15485
Signed-off-by: Valentin Rothberg <[email protected]>
mheon added a commit to mheon/libpod that referenced this issue Sep 6, 2022
Change only the compat API, so we don't force a breaking change
on Libpod API users.

Partial fix for containers#15485

Signed-off-by: Matthew Heon <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. macos MacOS (OSX) related podman-desktop
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants