Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remotecache: replace CheckDescriptor with Info #4784

Merged
merged 1 commit into from
Mar 25, 2024

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Mar 20, 2024

This tries to replace the CheckDescriptor interface detection with the Info() method that was added in v0.13 to the provider to avoid cases like #4771 .

@tonistiigi tonistiigi force-pushed the checkdescriptor-info branch from 28665c2 to 756f26c Compare March 20, 2024 01:55
@@ -313,10 +313,22 @@ func (p lazyRefProvider) Info(ctx context.Context, dgst digest.Digest) (content.
if dgst != p.desc.Digest {
return content.Info{}, errdefs.ErrNotFound
}
if err := p.Unlazy(ctx); err != nil {
return content.Info{}, errdefs.ErrNotFound
info, err := p.ref.cm.ContentStore.Info(ctx, dgst)
Copy link
Member Author

Choose a reason for hiding this comment

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

I changed the behavior of this function as worker.FromRemote() and cache marshaling uses this function to detect that content is available without opening reader or unlazy.

@ktock Looks like a stargz test broke so I think this was somehow used. Is it required for the unlazy to happen here (or maybe the test issue is something else)? The function was added in https://github.com/moby/buildkit/pull/4558/files#diff-c01e7be139ae4532b9aeef7b932fe60d3eb81680a7f4669b9dd0992ce71284f5R312 so I'm surprised it has this effect.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
@tonistiigi tonistiigi force-pushed the checkdescriptor-info branch from 756f26c to da7aa16 Compare March 20, 2024 14:37
@tonistiigi
Copy link
Member Author

cc @vvoland

@tonistiigi tonistiigi merged commit db890a3 into moby:master Mar 25, 2024
72 checks passed
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.

3 participants