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

unmarshalConvertedConfig(): handle zstd compression #3527

Merged
merged 2 commits into from
Sep 21, 2021

Conversation

nalind
Copy link
Member

@nalind nalind commented Sep 20, 2021

What type of PR is this?

/kind bug

What this PR does / why we need it:

The Docker manifest format doesn't currently support listing layers compressed using zstd, so we trigger an error when we try to convert an in-memory OCI manifest to the Docker format as a preliminary step in reading the image's config blob in the Docker format.

Instead, first create a temporary copy of the manifest, and then force the MIME types for all layers in the temporary copy of the manifest to appear to be compressed using gzip. Both OCI and Docker formats will accept the resulting manifest without issue. We throw the copy away after we've read the config blob, so the wackiness should be contained.

How to verify it

New integration test!

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

@openshift-ci openshift-ci bot added kind/bug Categorizes issue or PR as related to a bug. approved labels Sep 20, 2021
@nalind
Copy link
Member Author

nalind commented Sep 20, 2021

Related: containers/image#1379

@rhatdan
Copy link
Member

rhatdan commented Sep 20, 2021

@giuseppe @vrothberg @mtrmac PTAL

Add the --dest-compress, --dest-decompress, --dest-compress-format,
and --dest-compress-level options to the "copy" test helper.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
The Docker manifest format doesn't currently support listing layers
compressed using zstd, so we trigger an error when we try to convert an
in-memory OCI manifest to the Docker format as a preliminary step in
reading the image's config blob in the Docker format.

Instead, first create a temporary copy of the manifest, and then force
the MIME types for all layers in the temporary copy of the manifest to
appear to be compressed using gzip.  Both OCI and Docker formats will
accept the resulting manifest without issue.  We throw the copy away
after we've read the config blob, so the wackiness should be contained.

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

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@giuseppe
Copy link
Member

thanks, this solves the issue I've seen

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.

/lgtm

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 21, 2021

[APPROVALNOTIFIER] This PR is APPROVED

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

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

@openshift-merge-robot openshift-merge-robot merged commit fb84638 into containers:main Sep 21, 2021
@nalind nalind deleted the zstd-import branch September 21, 2021 12:19
@mtrmac
Copy link
Collaborator

mtrmac commented Sep 22, 2021

LGTM, for the record.

@giuseppe
Copy link
Member

giuseppe commented Nov 2, 2021

backport to 1.23: #3612

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved kind/bug Categorizes issue or PR as related to a bug. lgtm locked - please file new issue/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants