mirror of
https://github.com/containers/skopeo.git
synced 2025-10-22 03:24:25 +00:00
vendor containers/image
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
8
vendor/github.com/containers/image/copy/copy.go
generated
vendored
8
vendor/github.com/containers/image/copy/copy.go
generated
vendored
@@ -112,6 +112,14 @@ func Image(ctx *types.SystemContext, policyContext *signature.PolicyContext, des
|
||||
src := image.FromSource(rawSource)
|
||||
defer src.Close()
|
||||
|
||||
multiImage, err := src.IsMultiImage()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if multiImage {
|
||||
return fmt.Errorf("can not copy %s: manifest contains multiple images", transports.ImageName(srcRef))
|
||||
}
|
||||
|
||||
// Please keep this policy check BEFORE reading any other information about the image.
|
||||
if allowed, err := policyContext.IsRunningImageAllowed(src); !allowed || err != nil { // Be paranoid and fail if either return value indicates so.
|
||||
return fmt.Errorf("Source image rejected: %v", err)
|
||||
|
Reference in New Issue
Block a user