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

Method bpcPreserveEncrypted

copy/compression.go:138–152  ·  view source on GitHub ↗

bpcPreserveEncrypted checks if the input is encrypted, and returns a *bpCompressionStepData if so.

(stream *sourceStream, _ bpDetectCompressionStepData)

Source from the content-addressed store, hash-verified

136
137// bpcPreserveEncrypted checks if the input is encrypted, and returns a *bpCompressionStepData if so.
138func (ic *imageCopier) bpcPreserveEncrypted(stream *sourceStream, _ bpDetectCompressionStepData) (*bpCompressionStepData, error) {
139 if isOciEncrypted(stream.info.MediaType) {
140 // We can’t do anything with an encrypted blob unless decrypted.
141 logrus.Debugf("Using original blob without modification for encrypted blob")
142 return &bpCompressionStepData{
143 operation: bpcOpPreserveOpaque,
144 uploadedOperation: types.PreserveOriginal,
145 uploadedAlgorithm: nil,
146 srcCompressorBaseVariantName: internalblobinfocache.UnknownCompression,
147 uploadedCompressorBaseVariantName: internalblobinfocache.UnknownCompression,
148 uploadedCompressorSpecificVariantName: internalblobinfocache.UnknownCompression,
149 }, nil
150 }
151 return nil, nil
152}
153
154// bpcCompressUncompressed checks if we should be compressing an uncompressed input, and returns a *bpCompressionStepData if so.
155func (ic *imageCopier) bpcCompressUncompressed(stream *sourceStream, detected bpDetectCompressionStepData) (*bpCompressionStepData, error) {

Callers

nothing calls this directly

Calls 1

isOciEncryptedFunction · 0.85

Tested by

no test coverage detected