Skip to content

Conversation

@bpcreech
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

As noted in #2099, if you use container_import to declare foreign layers, then depend on that in a container_image or container_push as a whole-image .tar, you lose the foreign layer URLs, resulting in an invalid image. This is because compat/reader.go loads the foreign image information from the image manifest first, then overwrites that with the empty stub layer found in the tarball. You can observe the loss of information in the resulting image's manifest.

This used to work with the Python-language image reader, but broke in the move to the Golang pusher.

Issue Number: #2099

What is the new behavior?

We load the foreign layers last so that the stub information is overwritten.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Copy link
Collaborator

@gravypod gravypod left a comment

Choose a reason for hiding this comment

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

LGTM.

@gravypod gravypod merged commit 3cc173a into bazelbuild:master Sep 22, 2022
St0rmingBr4in pushed a commit to St0rmingBr4in/rules_docker that referenced this pull request Oct 17, 2022
Co-authored-by: Ben Creech <bpcreech@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants