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

manifest.GuessMIMEType(): recognize self-described OCI manifests #1419

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

nalind
Copy link
Member

@nalind nalind commented Nov 29, 2021

Newer versions of the OCI spec include the mediaType field in image manifests and image indexes, and if they include them, save ourselves some work by using that information.

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.

Good idea, 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.

Please update also the comment below, something like mtrmac@665a421 .

(I’m not sure when I’ll finish that wider work, so merging this part now makes perfect sense.)

@nalind
Copy link
Member Author

nalind commented Nov 29, 2021

Oof, I need to add tests for this.

Newer versions of the OCI spec include the mediaType field in image
manifests and image indexes, and if they include them, save ourselves
some work by using that information.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
@nalind
Copy link
Member Author

nalind commented Nov 29, 2021

Added "nomime" variants to the existing OCI test cases for GuessMIMEType(), and started setting the MediaType field by default in places where we construct OCI manifests. Basically swiped @mtrmac's updates from mtrmac@665a421.

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.

LGTM assuming tests pass. Thanks!

@rhatdan
Copy link
Member

rhatdan commented Nov 29, 2021

LGTM

@rhatdan rhatdan merged commit fa70420 into containers:main Nov 29, 2021
@nalind nalind deleted the guess-manifests branch November 29, 2021 18:06
mtrmac added a commit to mtrmac/skopeo that referenced this pull request Dec 2, 2021
... to a version past 1.0.2, just to keep various
dependency checkers happy.

> go get github.com/opencontainers/image-spec@v1.0.2-0.20211123152302-43a7dee1ec31

The commit is intended to match containers/image#1419
to minimize churn.

NOTE: This is NOT a fix for CVE-2021-41190 / GHSA-77vh-xpmg-72qh ,
that was fixed in Skopeo 1.5.2.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
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.

None yet

4 participants