-
Notifications
You must be signed in to change notification settings - Fork 18.9k
Description
- originally posted in c8d: test a backend dependent error on pull #46517 (comment)
The containerd error is less informative than the old one, because it doesn't show WHAT we weren't able to match (which could be obvious if a user explicitly passed a --platform, but less so if not, but could also be that user passed a partial platform, and we normalized it).
The "non-snapshotter" error looks to be this one;
Lines 939 to 945 in 0d9da73
| type noMatchesErr struct { | |
| platform ocispec.Platform | |
| } | |
| func (e noMatchesErr) Error() string { | |
| return fmt.Sprintf("no matching manifest for %s in the manifest list entries", formatPlatform(e.platform)) | |
| } |
For containerd, the error is produced here;
moby/vendor/github.com/containerd/containerd/images/handlers.go
Lines 310 to 312 in 0d9da73
| if len(children) == 0 { | |
| return children, fmt.Errorf("no match for platform in manifest: %w", errdefs.ErrNotFound) | |
| } |
I guess ideally the containerd error would be somewhat more informative (what were we trying to match, and couldn't find?), but it looks like that's less trivial, because that's fully up to the HandlerFunc that's passed (which does the filtering).
The alternative here would be to handle this on our side: when we get the result. The error returned is typed; it's a errdefs.ErrNotFound, so we can decorate the error (and perhaps we can decorate it regardless of what the reason was), i.e.;
if cerrdefs.IsNotFound(err) {
err = fmt.Errorf("no matching manifest for %s: %w", formatPlatform(e.platform), err)
} else {
err = fmt.Errorf("failed to find matching manifest for %s: %w", formatPlatform(e.platform), err)
}(I removed "in the manifest list entries" from the above, but maybe we should keep it, not sure if it's "too much")
Metadata
Metadata
Assignees
Labels
Type
Projects
Status