chunked: report TOCDigest for converted layers
even if we validated the full layer, report the TOC Digest as well so the upper layer can use both. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
This commit is contained in:
parent
394685cfa0
commit
9343f9f792
|
|
@ -1612,7 +1612,6 @@ func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions, diff
|
|||
stream := c.stream
|
||||
|
||||
var uncompressedDigest digest.Digest
|
||||
tocDigest := c.tocDigest
|
||||
|
||||
if c.convertToZstdChunked {
|
||||
fd, err := unix.Open(dest, unix.O_TMPFILE|unix.O_RDWR|unix.O_CLOEXEC, 0o600)
|
||||
|
|
@ -1668,8 +1667,7 @@ func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions, diff
|
|||
|
||||
// the file was generated by us and the digest for each file was already computed, no need to validate it again.
|
||||
c.skipValidation = true
|
||||
// since we retrieved the whole file and it was validated, do not use the TOC digest, but set the uncompressed digest.
|
||||
tocDigest = ""
|
||||
// since we retrieved the whole file and it was validated, set the uncompressed digest.
|
||||
uncompressedDigest = diffID
|
||||
}
|
||||
|
||||
|
|
@ -1699,7 +1697,7 @@ func (c *chunkedDiffer) ApplyDiff(dest string, options *archive.TarOptions, diff
|
|||
Artifacts: map[string]interface{}{
|
||||
tocKey: toc,
|
||||
},
|
||||
TOCDigest: tocDigest,
|
||||
TOCDigest: c.tocDigest,
|
||||
UncompressedDigest: uncompressedDigest,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue