Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[release-1.15] blobcache: avoid an unnecessary NewImage()#2501

Merged
bors[bot] merged 1 commit into
podman-container-tools:release-1.15from
nalind:blobcache-duplicate-mismatch-1.15
Aug 1, 2020
Merged

[release-1.15] blobcache: avoid an unnecessary NewImage()#2501
bors[bot] merged 1 commit into
podman-container-tools:release-1.15from
nalind:blobcache-duplicate-mismatch-1.15

Conversation

@nalind

@nalind nalind commented Jul 31, 2020

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug

What this PR does / why we need it:

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.

How to verify it

Build an image with buildah bud with debugging enabled, using the hidden --blob-cache option. 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?

None

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]>
@nalind nalind changed the title blobcache: avoid an unnecessary NewImage() [release-1.15] blobcache: avoid an unnecessary NewImage() Jul 31, 2020
@rhatdan

rhatdan commented Aug 1, 2020

Copy link
Copy Markdown
Contributor

LGTM

@rhatdan

rhatdan commented Aug 1, 2020

Copy link
Copy Markdown
Contributor

Since this is an approved PR in master merging.
bors r+

@bors

bors Bot commented Aug 1, 2020

Copy link
Copy Markdown
Contributor

Build succeeded:

  • cirrus-ci/success

@bors bors Bot merged commit f1e64be into podman-container-tools:release-1.15 Aug 1, 2020
@nalind nalind deleted the blobcache-duplicate-mismatch-1.15 branch August 3, 2020 13:45
@nalind nalind mentioned this pull request Sep 3, 2020
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]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants