image/sourced.go
func FromSource(ctx context.Context, sys *types.SystemContext, src types.ImageSource) (types.ImageCloser, error) {
	img, err := FromUnparsedImage(ctx, sys, UnparsedInstance(src, nil))
	if err != nil {
		return nil, err
	}
	return &imageCloser{
		Image: img,
		src:   src,
	}, nil
}
func FromSource(ctx context.Context, sys *types.SystemContext, src types.ImageSource) (types.ImageCloser, error) {
	img, err := FromUnparsedImage(ctx, sys, UnparsedInstance(src, nil))
	if err != nil {
		return nil, err
	}
	return &imageCloser{
		Image: img,
		src:   src,
	}, nil
}
func FromSource ( ctx context . Context , sys * types . SystemContext , src types . ImageSource ) ( types . ImageCloser , error ) { img , err := FromUnparsedImage ( ctx , sys , UnparsedInstance ( src , nil ) ) if err != nil { return nil , err } return & imageCloser { Image : img , src : src , } , nil }
// FromSource returns a types.ImageCloser implementation for the default instance of source.
// If source is a manifest list, .Manifest() still returns the manifest list,
// but other methods transparently return data from an appropriate image instance.
//
// The caller must call .Close() on the returned ImageCloser.
//
// FromSource “takes ownership” of the input ImageSource and will call src.Close()
// when the image is closed.  (This does not prevent callers from using both the
// Image and ImageSource objects simultaneously, but it means that they only need to
// the Image.)
//
// NOTE: If any kind of signature verification should happen, build an UnparsedImage from the value returned by NewImageSource,
// verify that UnparsedImage, and convert it into a real Image via image.FromUnparsedImage instead of calling this function.
FromSource returns a types . ImageCloser implementation for the default instance of source . If source is a manifest list . Manifest () still returns the manifest list but other methods transparently return data from an appropriate image instance . The caller must call . Close () on the returned ImageCloser . FromSource “takes ownership” of the input ImageSource and will call src . Close () when the image is closed . ( This does not prevent callers from using both the Image and ImageSource objects simultaneously but it means that they only need to the Image . ) NOTE : If any kind of signature verification should happen build an UnparsedImage from the value returned by NewImageSource verify that UnparsedImage and convert it into a real Image via image . FromUnparsedImage instead of calling this function .