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

Function shouldRequireCompressionFormatMatch

copy/copy.go:189–194  ·  view source on GitHub ↗

Internal function to validate `requireCompressionFormatMatch` for copySingleImageOptions

(options *Options)

Source from the content-addressed store, hash-verified

187
188// Internal function to validate `requireCompressionFormatMatch` for copySingleImageOptions
189func shouldRequireCompressionFormatMatch(options *Options) (bool, error) {
190 if options.ForceCompressionFormat && (options.DestinationCtx == nil || options.DestinationCtx.CompressionFormat == nil) {
191 return false, fmt.Errorf("cannot use ForceCompressionFormat with undefined default compression format")
192 }
193 return options.ForceCompressionFormat, nil
194}
195
196// Image copies image from srcRef to destRef, using policyContext to validate
197// source image admissibility. It returns the manifest which was written to

Callers 2

prepareInstanceCopiesFunction · 0.85
ImageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…