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 5, 2024
1 parent aa84439 commit 450bf17
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions integration/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 450bf17

Please sign in to comment.