From 5f6db2af5a1e9998933867ac29db5d5705a613cf Mon Sep 17 00:00:00 2001 From: Haoliang <109199020+yuehaoliang-microsoft@users.noreply.github.com> Date: Mon, 10 Oct 2022 14:30:43 +0800 Subject: [PATCH] fix: change to use repo instead of repo.manifest because it needs to fetch a blob (#637) Resolve #636 Signed-off-by: Haoliang Yue --- cmd/oras/manifest/fetch.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/oras/manifest/fetch.go b/cmd/oras/manifest/fetch.go index 16ba6a891..7173a5c42 100644 --- a/cmd/oras/manifest/fetch.go +++ b/cmd/oras/manifest/fetch.go @@ -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 } @@ -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 } @@ -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 }