Skip to content

Commit

Permalink
fix: change to use repo instead of repo.manifest because it needs to …
Browse files Browse the repository at this point in the history
…fetch a blob (oras-project#637)

Resolve oras-project#636 

Signed-off-by: Haoliang Yue <[email protected]>
  • Loading branch information
yuehaoliang authored and Terry Howe committed Feb 2, 2023
1 parent c0cb4d0 commit b31125d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cmd/oras/manifest/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func fetchManifest(opts fetchOptions) (fetchErr error) {
return err
}

manifests, err := opts.CachedTarget(repo.Manifests())
src, err := opts.CachedTarget(repo)
if err != nil {
return err
}
Expand All @@ -113,7 +113,7 @@ func fetchManifest(opts fetchOptions) (fetchErr error) {
// fetch manifest descriptor only
fetchOpts := oras.DefaultResolveOptions
fetchOpts.TargetPlatform = targetPlatform
desc, err = oras.Resolve(ctx, manifests, opts.targetRef, fetchOpts)
desc, err = oras.Resolve(ctx, src, opts.targetRef, fetchOpts)
if err != nil {
return err
}
Expand All @@ -122,7 +122,7 @@ func fetchManifest(opts fetchOptions) (fetchErr error) {
var content []byte
fetchOpts := oras.DefaultFetchBytesOptions
fetchOpts.TargetPlatform = targetPlatform
desc, content, err = oras.FetchBytes(ctx, manifests, opts.targetRef, fetchOpts)
desc, content, err = oras.FetchBytes(ctx, src, opts.targetRef, fetchOpts)
if err != nil {
return err
}
Expand Down

0 comments on commit b31125d

Please sign in to comment.