-
Notifications
You must be signed in to change notification settings - Fork 837
[do-not-merge] Print as much as we can in 'inspect' even for non-image artifacts. #2600
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
base: main
Are you sure you want to change the base?
Conversation
This commit removes the check for MediaTypeImageConfig MediType from Inspect function. Instead, it lets the existing code to parse the OCI Config blob and print the ImageInspectInfo. For non-image artifacts, this info can be incomplete, but still valid. If invalid config is found, the Unmarshal returns an error. Signed-off-by: Jan Kaluza <[email protected]>
167a49b
to
f1e8cac
Compare
I will have to do this change in c/image. Just testing it here. |
Thanks!
I don’t think that’s very likely; the fields are fairly image-specific. And, fundamentally, it’s just not valid to randomly read JSON fields from an entirely unknown data format and assume their meaning is consistent with images. I think such code is a forward-compatibility risk. As is, out of the 12 items in current output, there are about 3 that are relevant to OCI artifacts in general, without specific support for a specific artifact MIME type. The larger context of handling OCI artifacts with
Hence I’m thinking about something like #1283 . I don’t have much of a design in mind, but I feel fairly confident there’s ~no value in adding support for OCI artifacts to the current format. |
@mtrmac , Thanks for your message. You are absolutely right that this needs to be reworked. I also admitted that on a stand-up yesterday and started reading more about OCI artifacts this morning. As I understand it, the way forward is probably redesigning the
I think something like that would definitely make the skopeo more predictable to use. I'm not sure how aligned is this plan with RUN-2712, but I like it more than changing the current "inspect" in the backward-incompatible way. What do you think? |
(In general, I think of
Ultimately, users can either write their own consumer, or script something using
Maybe? Generally Skopeo has been a very thin wrapper over c/image, and Skopeo-specific features tend to suffer. What would the artifact-specific parser do? (Well, there is the current Podman mechanism of
I’d start with (some variant of / name of) For many artifacts, the only things we can reasonably report without building specific parsers is the MIME type, and config/layer blob details, and I think that’s perfectly fine. Anyone consuming a specific MIME type will probably need a tool to do that, and that tool can also provide a specific “inspect” feature; that doesn’t strictly need to exist in Skopeo. Skopeo does need to provide a way to answer “I have this repo:tag; what is this thing?”. |
This commit removes the check for MediaTypeImageConfig MediType from Inspect function. Instead, it lets the existing code to parse the OCI Config blob and print the ImageInspectInfo.
For non-image artifacts, this info can be incomplete, but still valid. If invalid config is found, the Unmarshal returns an error.
Resolves: #1933