Skip to content

Commit

Permalink
Also change the MIME type in manifest when decompressing a layer
Browse files Browse the repository at this point in the history
... for purposes of comparison

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Feb 2, 2024
1 parent dbe78bc commit eac2edb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ func decompressDir(t *testing.T, dir string) {
rawLayer["size"] = uncompressedSize
var mimeType string
getRawMapField(t, rawLayer, "mediaType", &mimeType)
//if strings.HasSuffix(mimeType, ".gzip") …
if strings.HasSuffix(mimeType, ".gzip") { // This should use CutSuffix with Go ≥1.20
rawLayer["mediaType"] = strings.TrimSuffix(mimeType, ".gzip")
}

rawLayers[i] = rawLayer
}
Expand Down

0 comments on commit eac2edb

Please sign in to comment.