[release-1.15] blobcache: avoid an unnecessary NewImage()#2501
Merged
bors[bot] merged 1 commit intoAug 1, 2020
Merged
Conversation
Avoid calling NewImage() on the source reference when the ImageSource that we already have returns nil from its LayerInfosForCopy() method. For our container-as-image references, that causes a re-extraction of uncached blobs, recomputing their digests, rebuilding the config blobs and manifests. The image library's copy.Image() function then asks the source reference that we're wrapping for blobs that we listed in the rebuilt manifest, and if any of those values differ, we fail to read them. This would have only affected builds that specified a blob cache. Signed-off-by: Nalin Dahyabhai <[email protected]>
Contributor
|
LGTM |
Contributor
|
Since this is an approved PR in master merging. |
Contributor
|
Build succeeded:
|
Merged
bors Bot
added a commit
that referenced
this pull request
Sep 3, 2020
2580: Bump to v1.15.2 r=TomSweeneyRedHat a=nalind #### What type of PR is this? /kind other #### What this PR does / why we need it: Bump our version number v1.15.2 for tagging a new release. #### How to verify it Verify that I didn't miss a spot where we report that we're an earlier 1.15 release. #### Which issue(s) this PR fixes: None #### Special notes for your reviewer: This is basically about rolling #2501 into a tagged release. Users who aren't using the hidden `--blob-cache` option should be the only ones who are impacted at all. #### Does this PR introduce a user-facing change? ``` None ``` Co-authored-by: Nalin Dahyabhai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind bug
What this PR does / why we need it:
Avoid calling
NewImage()on the source reference when theImageSourcethat we already have returnsnilfrom itsLayerInfosForCopy()method.For our container-as-image references, that causes a re-extraction of uncached blobs, recomputing their digests, rebuilding the config blobs and manifests.
The image library's
copy.Image()function then asks the source reference that we're wrapping for blobs that we listed in the rebuilt manifest, and if any of those values differ, we fail to read them.This would have only affected builds that specified a blob cache.
How to verify it
Build an image with
buildah budwith debugging enabled, using the hidden--blob-cacheoption. Observe that before this fix is applied, for each layer we commit, the layers list is computed twice, temporary directories are created twice, and the config blobs and manifests are generated twice. With the fix applied, these things should only happen once.Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Cherry-picked from #2500.
Does this PR introduce a user-facing change?