diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/github.com/containers/image/copy/copy.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vendor/github.com/containers/image/copy/copy.go b/vendor/github.com/containers/image/copy/copy.go index 183993c5d..59354ea38 100644 --- a/vendor/github.com/containers/image/copy/copy.go +++ b/vendor/github.com/containers/image/copy/copy.go @@ -533,20 +533,21 @@ func (ic *imageCopier) copyLayer(ctx context.Context, srcInfo types.BlobInfo) (t if err != nil { return types.BlobInfo{}, "", err } - var diffIDResult diffIDResult // = {digest:""} if diffIDIsNeeded { select { case <-ctx.Done(): return types.BlobInfo{}, "", ctx.Err() - case diffIDResult = <-diffIDChan: + case diffIDResult := <-diffIDChan: if diffIDResult.err != nil { return types.BlobInfo{}, "", errors.Wrap(diffIDResult.err, "Error computing layer DiffID") } logrus.Debugf("Computed DiffID %s for layer %s", diffIDResult.digest, srcInfo.Digest) ic.c.cachedDiffIDs[srcInfo.Digest] = diffIDResult.digest + return blobInfo, diffIDResult.digest, nil } + } else { + return blobInfo, ic.c.cachedDiffIDs[srcInfo.Digest], nil } - return blobInfo, diffIDResult.digest, nil } // copyLayerFromStream is an implementation detail of copyLayer; mostly providing a separate “defer” scope. |