erofs-differ: fix EROFS native image support

A dumb bug was just found after I worked out a usable native
converter [1], instead of relying on some prebuilt image..

[1] https://github.com/erofs/erofs-container-toolkit
Signed-off-by: Gao Xiang <xiang@kernel.org>
This commit is contained in:
Gao Xiang
2025-05-13 23:57:39 +08:00
parent 58cd33307f
commit 5f2200b2c7

View File

@@ -76,8 +76,8 @@ func NewErofsDiffer(store content.Store, mkfsExtraOpts []string) differ {
// Since `images.DiffCompression` doesn't support arbitrary media types,
// disallow non-empty suffixes for now.
func isErofsMediaType(mt string) bool {
mediaType, ext, ok := strings.Cut(mt, "+")
if !ok || ext != "" {
mediaType, _, hasExt := strings.Cut(mt, "+")
if hasExt {
return false
}
return strings.HasSuffix(mediaType, ".erofs")