From 8f2a7c65ff6bee14a4c217474deb9affb4077881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Fri, 2 Feb 2024 23:58:52 +0100 Subject: [PATCH] Also change the MIME type in manifest when decompressing a layer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ... for purposes of comparison Signed-off-by: Miloslav Trmač --- integration/utils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/integration/utils.go b/integration/utils.go index e19e3f06..f0e44843 100644 --- a/integration/utils.go +++ b/integration/utils.go @@ -266,6 +266,11 @@ func decompressDir(t *testing.T, dir string) { rawLayer["digest"] = uncompressedDigest.String() rawLayer["size"] = uncompressedSize + var mimeType string + getRawMapField(t, rawLayer, "mediaType", &mimeType) + if strings.HasSuffix(mimeType, ".gzip") { // This should use CutSuffix with Go ≥1.20 + rawLayer["mediaType"] = strings.TrimSuffix(mimeType, ".gzip") + } rawLayers[i] = rawLayer }