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

image list: return all associated names #7654

Merged
merged 1 commit into from
Sep 17, 2020

Conversation

vrothberg
Copy link
Member

Always return all associated names / repo tags of an image and fix a bug
with malformed repo tags.

Previously, Podman returned all names only with --all but this flag
only instructs to list intermediate images and should not alter
associated names. With --all Podman queried the repo tags of an image
which splits all tagged names into repository and tag which is then
reassembled to eventually be parsed again in the frontend. Lot's of
redundant CPU heat and buggy as the reassembly didn't consider digests
which ultimately broke parsing in the frontend.

Fixes: #7651
Signed-off-by: Valentin Rothberg [email protected]

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

rhatdan commented Sep 16, 2020

LGTM

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 this is the last caller of ReposToMap, shouldn’t it be removed? That would EDIT allowavoid similar confusion for any future callers.
  • Is it really correct to put digests to the RepoTags field? (I can’t quickly find documentation of the type). See also ImageToImageSummary. OTOH tokenRepoTag does seem to be ready to handle digests.

@vrothberg
Copy link
Member Author

* If this is the last caller of `ReposToMap`, shouldn’t it be removed? That would **EDIT allowavoid** similar confusion for any future callers.

Good catch, just removed it.

* Is it really correct to put digests to the Repo**Tags** field? (I can’t quickly find documentation of the type). See also `ImageToImageSummary`. OTOH `tokenRepoTag` does seem to be ready to handle digests.

I think that's okay. RepoTags is part of the entities return type where we have full control over. We can change the name to better reflect the semantics (and also document the fields) in the future.

@mtrmac
Copy link
Collaborator

mtrmac commented Sep 16, 2020

RepoTags is part of the entities return type where we have full control over. We can change the name to better reflect the semantics (and also document the fields) in the future.

AFAICT it is visible in the JSON output of podman images, but I may well have overlooked something; I didn’t read the code end-to-end.

Either way, displaying unexpected digests is better than not displaying anything at all, so this is clearly an improvement.

// Prevent regressing on issue #7651.
result := podmanTest.Podman([]string{"images", "--all"})
result.WaitWithDefaultTimeout()
Expect(result).Should(Exit(0))
Copy link
Member

Choose a reason for hiding this comment

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

You know my feelings about "run a test and only check exit code, and just blindly la-la-la about its actual output". I'm writing my own system test anyway, so this will be covered, but I do wish I could instill the habit of checking results.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the reminder, @edsantiago! It was not on purpose but happened in a hurry. Since it's not merged, I will improve the test.

Copy link
Member

@edsantiago edsantiago left a comment

Choose a reason for hiding this comment

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

Seems to work. I'm a little confused that when I pull same-image-I-already-have@same-sha I then get two lines, one with a <none> tag that can only be rmi'ed (untagged) by rmi ...@sha, but I can live with that.

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edsantiago, 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:
  • OWNERS [edsantiago,vrothberg]

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

@mheon
Copy link
Member

mheon commented Sep 16, 2020

@edsantiago Probably a bug, but a separate one. IMO, file it and we can fix later.

@TomSweeneyRedHat
Copy link
Member

@TomSweeneyRedHat
Copy link
Member

Changes LGTM
A test failed, but it looks to be a network hiccup.

@vrothberg
Copy link
Member Author

And targets: https://bugzilla.redhat.com/show_bug.cgi?id=1879622

Thanks! I referenced the BZ in the backport.

@vrothberg
Copy link
Member Author

Seems to work. I'm a little confused that when I pull same-image-I-already-have@same-sha I then get two lines, one with a <none> tag that can only be rmi'ed (untagged) by rmi ...@sha, but I can live with that.

Good catch! Docker prints the a single item only (in case there's a "real" tag).

@vrothberg
Copy link
Member Author

/hold
Don't merge for now. The backport is merged, to fix the more serious error. So we have time here to take care of beautifying.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 17, 2020
Always return all associated names / repo tags of an image and fix a bug
with malformed repo tags.

Previously, Podman returned all names only with `--all` but this flag
only instructs to list intermediate images and should not alter
associated names.  With `--all` Podman queried the repo tags of an image
which splits all *tagged* names into repository and tag which is then
reassembled to eventually be parsed again in the frontend.  Lot's of
redundant CPU heat and buggy as the reassembly didn't consider digests
which ultimately broke parsing in the frontend.

Fixes: containers#7651
Signed-off-by: Valentin Rothberg <[email protected]>
@vrothberg
Copy link
Member Author

Seems to work. I'm a little confused that when I pull same-image-I-already-have@same-sha I then get two lines, one with a <none> tag that can only be rmi'ed (untagged) by rmi ...@sha, but I can live with that.

Got that sorted out as well.

@vrothberg
Copy link
Member Author

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 17, 2020
@rhatdan
Copy link
Member

rhatdan commented Sep 17, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 17, 2020
@openshift-merge-robot openshift-merge-robot merged commit d8414ad into containers:master Sep 17, 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 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 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 images -a breaks after pulling <image>@<digest>
8 participants