Skip to content

Commit

Permalink
oci/clinet: ensure Pull set URL field in metadata it returns
Browse files Browse the repository at this point in the history
Signed-off-by: Ilya Dmitrichenko <errordeveloper@gmail.com>
  • Loading branch information
errordeveloper committed Sep 26, 2023
1 parent cfe218b commit 6629b78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions oci/client/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ func (c *Client) Pull(ctx context.Context, url, outDir string) (*Metadata, error
}

meta := MetadataFromAnnotations(manifest.Annotations)
meta.URL = url
meta.Digest = ref.Context().Digest(digest.String()).String()

layers, err := img.Layers()
Expand Down
1 change: 1 addition & 0 deletions oci/client/pull_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func Test_PullAnyTarball(t *testing.T) {
g.Expect(m.Created).To(BeEmpty())
g.Expect(m.Revision).To(BeEmpty())
g.Expect(m.Source).To(BeEmpty())
g.Expect(m.URL).To(Equal(dst))
g.Expect(m.Digest).ToNot(BeEmpty())
g.Expect(extractTo).To(BeADirectory())

Expand Down

0 comments on commit 6629b78

Please sign in to comment.