MCPcopy Create free account
hub / github.com/dagger/dagger / tryResolveLocalManifestDescriptor

Function tryResolveLocalManifestDescriptor

engine/server/resolver/resolver.go:878–899  ·  view source on GitHub ↗
(
	ctx context.Context,
	provider content.Provider,
	desc ocispecs.Descriptor,
	matcher platforms.MatchComparer,
	checkRootManifestPlatform bool,
)

Source from the content-addressed store, hash-verified

876)
877
878func 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
901func resolveLocalManifestDescriptor(
902 ctx context.Context,

Callers 2

Calls 1

Tested by

no test coverage detected