Importer: Handle Blob Media Types Consistently
Context
Blob media types are not being handled in a consistent manner in the importer. Blobs media types are likely not absolute, but rather change in related to their associated manifests. Therefore, we should only use application/octet-stream for blobs in the blobs table, and we should always use the media type recorded in the manifest JSON in the layers table.
Problem
The importer will use the media type present in the database, and has a similar issue for layer blobs as the API. However, we do a CreateOrFind here in the importer before writing the manifest struct, which effectively overwrites the correct media type for the configuration. This is a somewhat severe error, as this media type can be used to differentiate different types of manifests which need to be handled separately, but are otherwise identical, such as with the old cache manifests.
Solution
Blobs in the blob table need to always use application/octet-stream and use the media type recorded in the manifest JSON in the layers table, regardless of blob import order.