c8d/inspect: Ignore manifest with missing config#46238
Conversation
bff127f to
5767330
Compare
daemon/containerd/image.go
Outdated
| conf, err := img.Config(ctx) | ||
| if err != nil { | ||
| return err | ||
| return fmt.Errorf("failed to get config descriptor: %w", err) |
There was a problem hiding this comment.
Should these new errors have a specific type? e.g., should this be a NotFound error?
There was a problem hiding this comment.
Oh, I guess the reverse (as we handle NotFound different?)
There was a problem hiding this comment.
Hmm, there's a very small chance this could fail with NotFound because this is only reading the config descriptor from the manifest content. The only way this could fail with NotFound is if the manifest is missing or malformed, but then it wouldn't be considered by the walkImageManifests.
In theory this could happen if the content was deleted between walkImageManifests picked it up and the handler func was called.
So I guess it doesn't hurt to handle NotFound here, but return System in other cases.
Fix a failure to inspect image if any of its present manifest references an image config which isn't present locally. Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
5767330 to
a64adda
Compare
- What I did
Fixed failure to inspect image if any of its present manifest references an image config which isn't present locally.
- How I did it
Ignore c8d
NotFounderror when reading config inwalkImageManifests.- How to verify it
$ docker pull busybox:1.36.1 $ docker pull --platform linux/amd64 busybox:1.36.1 $ ctr content rm sha256:a416a98b71e224a31ee99cff8e16063554498227d2b696152a9c3e0aa65e5824 # Delete amd64 configBefore
After
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)