( ctx context.Context, provider content.Provider, desc ocispecs.Descriptor, matcher platforms.MatchComparer, checkRootManifestPlatform bool, )
| 876 | ) |
| 877 | |
| 878 | func tryResolveLocalManifestDescriptor( |
| 879 | ctx context.Context, |
| 880 | provider content.Provider, |
| 881 | desc ocispecs.Descriptor, |
| 882 | matcher platforms.MatchComparer, |
| 883 | checkRootManifestPlatform bool, |
| 884 | ) (ocispecs.Descriptor, ocispecs.Manifest, bool, error) { |
| 885 | manifestDesc, manifest, status, err := resolveLocalManifestDescriptor(ctx, provider, desc, matcher, checkRootManifestPlatform) |
| 886 | if err != nil { |
| 887 | return ocispecs.Descriptor{}, ocispecs.Manifest{}, false, err |
| 888 | } |
| 889 | switch status { |
| 890 | case localManifestResolutionFound: |
| 891 | return manifestDesc, manifest, true, nil |
| 892 | case localManifestResolutionIncomplete: |
| 893 | return ocispecs.Descriptor{}, ocispecs.Manifest{}, false, nil |
| 894 | case localManifestResolutionNoPlatformMatch: |
| 895 | return ocispecs.Descriptor{}, ocispecs.Manifest{}, false, fmt.Errorf("no manifest matches requested platform for %s", desc.Digest) |
| 896 | default: |
| 897 | return ocispecs.Descriptor{}, ocispecs.Manifest{}, false, fmt.Errorf("unknown local manifest resolution status %d", status) |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | func resolveLocalManifestDescriptor( |
| 902 | ctx context.Context, |
no test coverage detected