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

libimage: enforce "latest" tag when looking up images #836

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

vrothberg
Copy link
Member

Make sure to enforce the "latest" tag when looking up images in the
local storage. Also make sure that digested short-names are subject
to the extended digest lookups.

Context: containers/podman/issues/11964
Signed-off-by: Valentin Rothberg rothberg@redhat.com

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 22, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

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

@vrothberg
Copy link
Member Author

/hold

Do not merge until containers/podman#12010 is green.

@vrothberg
Copy link
Member Author

@mtrmac @containers/podman-maintainers PTAL

Copy link
Contributor

@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.

AFAICS it used to be that all names, incl. those with domains, were looked up using the lax suffix matching; now it only looks up short names?

Am I misreading it? Arguably, the case of suffix-matching example.com/foo to example.com/example.com/foo is a non-obvious corner case, and I’m not at all saying that it makes any sense to do that; basically just that it’s very worth highlighting and making a conscious decision about whether we want to change that.

(And is there sufficient test coverage? Either I’m misreading what the change is, or it’s a bit surprising how little the tests needed to change for those changes. [OTOH I could see an argument that this weird legacy code path is not worth testing in detail — but then again that’s exactly the kind of code where we wouldn’t notice breakage without tests… Entirely up to you as owner of this project.])

@@ -389,15 +389,16 @@ func (r *Runtime) lookupImageInDigestsAndRepoTags(name string, options *LookupIm
return nil, "", err
Copy link
Contributor

Choose a reason for hiding this comment

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

(The limbo comment above might be worth moderating a bit.)

libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Show resolved Hide resolved
libimage/runtime.go Outdated Show resolved Hide resolved
libimage/runtime.go Show resolved Hide resolved
Copy link
Contributor

@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, just non-blocking stylistic preferences.

Make sure to enforce the "latest" tag when looking up images in the
local storage.  Also make sure that digested short-names are subject
to the extended digest lookups.

Context: containers/podman/issues/11964
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Copy link
Contributor

@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.

LGTM.

@rhatdan
Copy link
Member

rhatdan commented Nov 22, 2021

/lgtm

@rhatdan
Copy link
Member

rhatdan commented Nov 22, 2021

/hold cancel

@openshift-merge-robot openshift-merge-robot merged commit d4e7724 into containers:main Nov 22, 2021
@vrothberg vrothberg deleted the fix-podman-11964 branch November 23, 2021 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants