Skip to content

Commit

Permalink
Populate image index for remoteImage
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Sankov authored and Anton Sankov committed Aug 27, 2024
1 parent 9010cd3 commit b697ec3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion image/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,16 @@ func tryRemote(ctx context.Context, imageName string, ref name.Reference, option
return nil, err
}

index, err := desc.ImageIndex()
if err != nil {
return nil, err
}

// Return v1.Image if the image is found in Docker Registry
return remoteImage{
name: imageName,
Image: img,
imageIndex: index,
ref: implicitReference{ref: ref},
descriptor: desc,
}, nil
Expand All @@ -99,7 +105,9 @@ type remoteImage struct {
name string
ref implicitReference
descriptor *remote.Descriptor

v1.Image
imageIndex v1.ImageIndex
}

func (img remoteImage) Name() string {
Expand Down Expand Up @@ -128,7 +136,7 @@ func (img remoteImage) RepoDigests() []string {
}

func (img remoteImage) Index() *v1.IndexManifest {
return nil
return img.Index()
}

type implicitReference struct {
Expand Down

0 comments on commit b697ec3

Please sign in to comment.