Skip to content

Commit

Permalink
Merge pull request #2801 from hshiina/idmapping
Browse files Browse the repository at this point in the history
Compute diffID for mapped-layer at creating image source
  • Loading branch information
openshift-merge-robot authored Nov 17, 2020
2 parents 60813b5 + 073f90b commit d31c5fb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions image.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,10 +321,7 @@ func (i *containerImageRef) NewImageSource(ctx context.Context, sc *types.System
}
// If we're not re-exporting the data, and we're reusing layers individually, reuse
// the blobsum and diff IDs.
if !i.exporting && !i.squash && layerID != i.layerID {
if layer.UncompressedDigest == "" {
return nil, errors.Errorf("unable to look up size of layer %q", layerID)
}
if !i.exporting && !i.squash && layerID != i.layerID && layer.UncompressedDigest != "" {
layerBlobSum := layer.UncompressedDigest
layerBlobSize := layer.UncompressedSize
diffID := layer.UncompressedDigest
Expand Down
3 changes: 3 additions & 0 deletions tests/namespaces.bats
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ load helpers
expect_output "$rootuid:$rootgid 4700"
run_buildah run $RUNOPTS "$ctr" stat -c '%u:%g %a' /somedir/someotherfile
expect_output "0:0 4700"

# Check that a container with mapped-layer can be committed.
run_buildah commit "$ctr" localhost/alpine-working:$i
done
}

Expand Down

0 comments on commit d31c5fb

Please sign in to comment.