Allow for images with artifacts layers to pull and run #9142
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows images that might have additional artifacts or no layers to pull content and still start properly. This follows the same pattern as in the transfer service: https://github.com/containerd/containerd/blob/main/pkg/unpack/unpacker.go#L188
Without this change you get
mismatched image rootfs and manifest layers
at the import and run steps. This isn't really true as the layers and manifest layers can match and while potentially still having other layers that would correspond to artifacts.Background
After several iterations of working with OCI artifacts for WASM with #8699 and feedback from users trying it out on runwasi, it was determined that the minimal number of changes to containerd would be beneficial so we could potentially use this in containerd today (via backport).
Some tests in runwasi are using this branch to validate pulling oci artifact containerd/runwasi#147