-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: handle not implemented error for Info() #5257
remotecache: handle not implemented error for Info() #5257
Conversation
6d3f356
to
74b0515
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
curious if matching the interface would've been an alternative, but not sure if we can with the Moby integration.
@@ -281,7 +282,9 @@ func marshalRemote(ctx context.Context, r *solver.Remote, state *marshalState) s | |||
if r.Provider != nil { | |||
for _, d := range r.Descriptors { | |||
if _, err := r.Provider.Info(ctx, d.Digest); err != nil { | |||
return "" | |||
if !cerrdefs.IsNotImplemented(err) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For others; I was curious if this should be using buildkit's or moby's errdefs
definitions, but the Provider.Info
interface looks to be defined by containerd;
buildkit/vendor/github.com/containerd/containerd/content/content.go
Lines 117 to 123 in bff1d81
// InfoProvider provides info for content inspection. | |
type InfoProvider interface { | |
// Info will return metadata about content available in the content store. | |
// | |
// If the content is not present, ErrNotFound will be returned. | |
Info(ctx context.Context, dgst digest.Digest) (Info, error) | |
} |
(wondering if GoDoc for the interface should also mention NotImplemented
, but maybe it's not strictly how containerd expected that to be handled other than "don't implement the interface")
OH! Typo in the commit message; perhaps good to fix if you want to be able to find it back; |
Moby graphdriver backend does not implement Info() and such case should not be used as a signal for blob needed to be skipped as it is unavailable. This requires a change in Moby side as well to return a typed error instead of string. Signed-off-by: Tonis Tiigi <[email protected]>
74b0515
to
8fdf84f
Compare
fixes #5242
Moby graphdriver backend does not implement Info() and such case should not be used as a signal for
blob needed to be skipped as it is unavailable.
This requires a change in Moby side as well to return a typed error instead of string.