-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
manifest list inspect single image #8100
manifest list inspect single image #8100
Conversation
@QiWang19 can you touch up the title please? "insepct" -> "inspect" |
I'd like to hear @edsantiago 's thought on the friendliness. Personally I don't think a query that only happens sometimes is not friendly at all, I think it's better to get the info with a warning. |
I'm trying to focus every minute I have today on Chris's big PR, and can't give this the attention it deserves. (And I'm out tomorrow and Friday). Sorry. My first reaction, though, is that I really dislike being prompted. I like error messages that indicate what went wrong and how to fix it (e.g. by a special command-line flag), and I like command-line flags that are forgiving or at least offer a best-effort attempt to Do The Right Thing so that scripts can be written robustly. HTH. |
I agree on avoiding the query, unless you are going to add a I also think this is not a mainstream command, so having it fail or print a warning would be better. If someone is playing with manifests they will quickly learn how to deal with them. Most users will never touch this code. |
38480f3
to
f924476
Compare
If having it fail is expected, #8023 may not be treated as a podman bug. The code used to report the manifest type error. But just tried docker manifest inspect, it returns the single manifest directly without any errors. |
f924476
to
b1d671f
Compare
pkg/domain/infra/abi/manifest.go
Outdated
|
||
switch manType { | ||
case manifest.DockerV2Schema2MediaType: | ||
fmt.Printf("Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fmt.Printf("Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) | |
fmt.Fprintf(os.Stderr, "Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) |
I know this has been bashed around a bit but errors should go to stderr IMHO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed.
b1d671f
to
2494324
Compare
pkg/domain/infra/abi/manifest.go
Outdated
|
||
switch manType { | ||
case manifest.DockerV2Schema2MediaType: | ||
fmt.Fprintf(os.Stderr, "Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once we start displaying at the Warning level, this should be logrus.Warnf.
Could you cleanup you commit message to match latest reality and fix spelling mistakes.
|
ae2b842
to
71ceaeb
Compare
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: QiWang19, 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 |
@containers/podman-maintainers PTAL. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a wording nit. @QiWang19 could you add some tests? I always want a test for fixes to make sure we're not re-regressing in the future.
pkg/domain/infra/abi/manifest.go
Outdated
|
||
switch manType { | ||
case manifest.DockerV2Schema2MediaType: | ||
logrus.Warnf("Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logrus.Warnf("Warning! The manifest type %s is not a manifest list. Displaying the the manifest of the single image.\n", manType) | |
logrus.Warnf("Warning! The manifest type %s is not a manifest list but a single image.\n", manType) |
71ceaeb
to
71b0e0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One tiny non-blocking format suggestion but LGTM
pkg/domain/infra/abi/manifest.go
Outdated
|
||
switch manType { | ||
case manifest.DockerV2Schema2MediaType: | ||
logrus.Warnf("Warning! The manifest type %s is not a manifest list but a single image.\n", manType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logrus.Warnf("Warning! The manifest type %s is not a manifest list but a single image.\n", manType) | |
logrus.Warnf("Warning! The manifest type %s is not a manifest list but a single image", manType) |
If the image name not a manifest list type, enable manifest inspect to return manifest of single image manifest type vnd.docker.distribution.manifest.v2+json. Signed-off-by: Qi Wang <[email protected]>
71b0e0e
to
57650aa
Compare
@containers/podman-maintainers PTAL |
LGTM |
/lgtm |
If the image name not a manifest list type, enable
manifest inspect
to return manifest of single image with manifest typeapplication/vnd.docker.distribution.manifest.v2+json
close #8023
Signed-off-by: Qi Wang [email protected]