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

Prefer read/write images over read/only images #8609

Merged
merged 1 commit into from
Dec 23, 2020

Conversation

rhatdan
Copy link
Member

@rhatdan rhatdan commented Dec 5, 2020

With additional stores there is a risk that you could have
multiple images with the same name. IE An older image in a
read/only store versus a newer version in the read/write store.

This patch will ignore multiple images with the same name iff
one is read/write and all of the others are read/only. It will
still return errors if only multiple read/only images or multiple
read/write images exists. Multipl read/write images should be
impossible.

Fixes: #8176

Signed-off-by: Daniel J Walsh dwalsh@redhat.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 5, 2020
@rhatdan
Copy link
Member Author

rhatdan commented Dec 5, 2020

@edsantiago @mtrmac PTAL

@rhatdan
Copy link
Member Author

rhatdan commented Dec 7, 2020

@containers/podman-maintainers PTAL

Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a test for it. Too easy to regress if we change change code.

@edsantiago
Copy link
Member

We already have a test; it's disabled. @rhatdan can you try removing the Skip and see if CI passes?

Skip("FIXME-8165: shortnames don't seem to work with quay (#8176)")

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If #8176 (comment) is right that the define.ErrMultipleImages check doesn’t work, this PR does not yet fix all of that bug report.

libpod/image/utils.go Outdated Show resolved Hide resolved
libpod/image/utils.go Outdated Show resolved Hide resolved
@rhatdan rhatdan force-pushed the image branch 3 times, most recently from 5c38ec3 to d6e30c2 Compare December 9, 2020 19:54
@rhatdan
Copy link
Member Author

rhatdan commented Dec 11, 2020

@mtrmac PTAL
I changed to return the multiple "R/O" images error if R/W image is not found and there are multiple images.

@mtrmac
Copy link
Collaborator

mtrmac commented Dec 11, 2020

@rhatdan Still #8609 (comment) .

@rhatdan
Copy link
Member Author

rhatdan commented Dec 11, 2020

> So if, searching for alpine, there is a read-only example.com/alpine, and a read-write example.net/alpine, this will silently ignore 
> the ambiguity and only return the read-write one. That doesn’t look right to me.

With additional stores this can happen, since the underlying containers/storage will show an older version of alpine. In this case we will prefer the read/write store, since this was either pulled in a newer version of ":latest" or rebuilt/tagged a newer version of latest. This is the situation that @edsantiago created to see this problem in the first place.

@mtrmac
Copy link
Collaborator

mtrmac commented Dec 11, 2020

With additional stores this can happen, since the underlying containers/storage will show an older version of alpine.

I’m not talking about different versions, but entirely different images. These are example.com/alpine and something-entirely-different-and-not-example.com/alpine.

(Your argument for accepting the newer image if both have exactly the same tag matching the user input, instead of failing on any change to the image, sounds very reasonable. I’m not at all sure about matching by ID. But that’s not my primary concern.)

libpod/image/utils.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK overall.


Still outstanding:

If #8176 (comment) is right that the define.ErrMultipleImages check doesn’t work, this PR does not yet fix all of that bug report.

or maybe split that into a separate tracked issue?

libpod/image/utils.go Outdated Show resolved Hide resolved
libpod/image/utils.go Show resolved Hide resolved
libpod/image/utils.go Outdated Show resolved Hide resolved
libpod/image/utils.go Outdated Show resolved Hide resolved
libpod/image/utils.go Outdated Show resolved Hide resolved
With additional stores there is a risk that you could have
multiple images with the same name.  IE An older image in a
read/only store versus a newer version in the read/write store.

This patch will ignore multiple images with the same name iff
one is read/write and all of the others are read/only.

Fixes: containers#8176

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
@baude
Copy link
Member

baude commented Dec 23, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 23, 2020
@openshift-merge-robot openshift-merge-robot merged commit bbc0deb into containers:master Dec 23, 2020
@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 23, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman image exists, with vfs.imagestore and image from quay, fails
7 participants