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

Resolve image name to ID before fetching digest to resolve false drift #92

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

optiz0r
Copy link
Contributor

@optiz0r optiz0r commented Dec 6, 2024

EL9.5 ships podman v5 with skopeo 1.16 up from 1.14. The behaviour of how image digests are reported has changed, causing podman::container to consider needing to fetch a new image on every run and unwanted container restarts.

podman image inspect --format='{{.Digest}}' now returns different hashes depending on whether an image ID or a tag is given as argument.

Skopeo reports the image digest in the registry as if podman image inspect were called with the image ID.

This code resolves the given image name (which might be an ID or a Tag) into the ID before trying to fetch the digest. This prevents the false drift.

Fixes #91

EL9.5 ships podman v5 with skopeo 1.16 up from 1.14. The behaviour of how
image digests are reported has changed, causing `podman::container` to
consider needing to fetch a new image on every run and unwanted container
restarts.

`podman image inspect --format='{{.Digest}}'` now returns different hashes
depending on whether an image ID or a tag is given as argument.

Skopeo reports the image digest in the registry as if podman image inspect
were called with the image ID.

This code resolves the given image name (which might be an ID or a Tag)
into the ID before trying to fetch the digest. This prevents the false
drift.

Fixes southalc#91
@southalc southalc merged commit 92fcc37 into southalc:master Dec 7, 2024
4 checks passed
@southalc
Copy link
Owner

southalc commented Dec 7, 2024

Thank you for tracking this down and contributing the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgraded to Podman 5.x on AlmaLinux 9.5 and now every container changes on every run
2 participants