MCPcopy Create free account
hub / github.com/containers/image / diffIDComputationGoroutine

Function diffIDComputationGoroutine

copy/single.go:968–977  ·  view source on GitHub ↗

diffIDComputationGoroutine reads all input from layerStream, uncompresses using decompressor if necessary, and sends its digest, and status, if any, to dest.

(dest chan<- diffIDResult, layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc)

Source from the content-addressed store, hash-verified

966
967// diffIDComputationGoroutine reads all input from layerStream, uncompresses using decompressor if necessary, and sends its digest, and status, if any, to dest.
968func diffIDComputationGoroutine(dest chan<- diffIDResult, layerStream io.ReadCloser, decompressor compressiontypes.DecompressorFunc) {
969 result := diffIDResult{
970 digest: "",
971 err: errors.New("Internal error: unexpected panic in diffIDComputationGoroutine"),
972 }
973 defer func() { dest <- result }()
974 defer layerStream.Close() // We do not care to bother the other end of the pipe with other failures; we send them to dest instead.
975
976 result.digest, result.err = computeDiffID(layerStream, decompressor)
977}
978
979// computeDiffID reads all input from layerStream, uncompresses it using decompressor if necessary, and returns its digest.
980func computeDiffID(stream io.Reader, decompressor compressiontypes.DecompressorFunc) (digest.Digest, error) {

Callers 2

copyLayerFromStreamMethod · 0.85

Calls 2

computeDiffIDFunction · 0.85
CloseMethod · 0.65

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…