Skip to content

pull: add cache for gcr bug#1024

Merged
tiborvass merged 1 commit intomoby:masterfrom
tonistiigi:gcr-workaround
Jun 17, 2019
Merged

pull: add cache for gcr bug#1024
tiborvass merged 1 commit intomoby:masterfrom
tonistiigi:gcr-workaround

Conversation

@tonistiigi
Copy link
Member

fix #720

Signed-off-by: Tonis Tiigi [email protected]

Signed-off-by: Tonis Tiigi <[email protected]>
ref = r.repo(ref) + "-" + session.FromContext(ctx)

cr, ok := r.m[ref]
cr.timeout = time.Now().Add(time.Minute)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why 1 minute?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as in moby. This should be enough to avoid the second request in most cases. Ideally, this could be connected to the /session dropping.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

var cache *resolverCache

func init() {
cache = newResolverCache()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but no need for init(), can be var cache = newResolverCache()

@tiborvass tiborvass merged commit 914d867 into moby:master Jun 17, 2019
@thaJeztah
Copy link
Member

Is this in the vendored code in Moby? If so we might want to backport to the 18.09 branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

buildkit + gcr.io private repos (credHelpers) do not stack

4 participants