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

Method remoteCacheKey

core/git_remote.go:135–143  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

133}
134
135func (repo *RemoteGitRepository) remoteCacheKey(ctx context.Context) (string, error) {
136 clientMetadata, err := engine.ClientMetadataFromContext(ctx)
137 if err != nil {
138 return "", err
139 }
140 inputs := []string{clientMetadata.SessionID, repo.URL.Remote()}
141 inputs = append(inputs, repo.remoteCacheScope()...)
142 return hashutil.HashStrings(inputs...).String(), nil
143}
144
145// Pipelines could query the same remote with different creds (e.g. a pipeline checking that creds were properly rotated)
146// instead of being too smart, we just scope the cache key to the auth configuration: less chance of cache poisoning

Callers 1

RemoteMethod · 0.95

Calls 5

remoteCacheScopeMethod · 0.95
HashStringsFunction · 0.92
RemoteMethod · 0.65
StringMethod · 0.65

Tested by

no test coverage detected