MCPcopy
hub / github.com/containerd/containerd / ContextWithRepositoryScope

Function ContextWithRepositoryScope

core/remotes/docker/scope.go:49–55  ·  view source on GitHub ↗

ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value.

(ctx context.Context, refspec reference.Spec, push bool)

Source from the content-addressed store, hash-verified

47
48// ContextWithRepositoryScope returns a context with tokenScopesKey{} and the repository scope value.
49func ContextWithRepositoryScope(ctx context.Context, refspec reference.Spec, push bool) (context.Context, error) {
50 s, err := RepositoryScope(refspec, push)
51 if err != nil {
52 return nil, err
53 }
54 return WithScope(ctx, s), nil
55}
56
57// WithScope appends a custom registry auth scope to the context.
58func WithScope(ctx context.Context, scope string) context.Context {

Callers 5

openReferrersMethod · 0.85
FetchMethod · 0.85
FetchByDigestMethod · 0.85
pushMethod · 0.85
ResolveMethod · 0.85

Calls 2

RepositoryScopeFunction · 0.85
WithScopeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…