Skip to content

Commit

Permalink
remote: Call Get() directly from remote.Image() (google#557)
Browse files Browse the repository at this point in the history
The descriptor.Image() code handles docker v2schema1 images cleanly, but
the Image code resricts the list, causing certain repositories to return
ManifestUnknown for images that exist.

By using the Get function, we reduce code slightly and handle schema1
images with an error that doesn't appear to imply that the image does
not exist.
  • Loading branch information
clrprod authored and jonjohnsonjr committed Oct 2, 2019
1 parent 560b689 commit ff1ac7f
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/v1/remote/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,7 @@ var _ partial.CompressedImageCore = (*remoteImage)(nil)

// Image provides access to a remote image reference.
func Image(ref name.Reference, options ...Option) (v1.Image, error) {
acceptable := []types.MediaType{
types.DockerManifestSchema2,
types.OCIManifestSchema1,
// We resolve these to images later.
types.DockerManifestList,
types.OCIImageIndex,
}

desc, err := get(ref, acceptable, options...)
desc, err := Get(ref, options...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ff1ac7f

Please sign in to comment.