mirror of
https://github.com/moby/moby.git
synced 2026-08-04 23:21:00 +00:00
Merge pull request #48701 from thaJeztah/keep_manifest_order
api: GET /images/json: preserve original manifest order
This commit is contained in:
@@ -248,13 +248,7 @@ func (i *ImageService) imageSummary(ctx context.Context, img images.Image, platf
|
||||
|
||||
if opts.Manifests {
|
||||
defer func() {
|
||||
// If the platform is available, prepend it to the list of platforms
|
||||
// otherwise append it at the end.
|
||||
if available {
|
||||
manifestSummaries = append([]imagetypes.ManifestSummary{mfstSummary}, manifestSummaries...)
|
||||
} else {
|
||||
manifestSummaries = append(manifestSummaries, mfstSummary)
|
||||
}
|
||||
manifestSummaries = append(manifestSummaries, mfstSummary)
|
||||
}()
|
||||
}
|
||||
|
||||
|
||||
@@ -247,11 +247,11 @@ func TestImageList(t *testing.T) {
|
||||
|
||||
assert.Check(t, is.Equal(i.Manifests[0].Kind, imagetypes.ManifestKindImage))
|
||||
if assert.Check(t, i.Manifests[0].ImageData != nil) {
|
||||
assert.Check(t, is.Equal(i.Manifests[0].ImageData.Platform.Architecture, "arm64"))
|
||||
assert.Check(t, is.Equal(i.Manifests[0].ImageData.Platform.Architecture, "amd64"))
|
||||
}
|
||||
assert.Check(t, is.Equal(i.Manifests[1].Kind, imagetypes.ManifestKindImage))
|
||||
if assert.Check(t, i.Manifests[1].ImageData != nil) {
|
||||
assert.Check(t, is.Equal(i.Manifests[1].ImageData.Platform.Architecture, "amd64"))
|
||||
assert.Check(t, is.Equal(i.Manifests[1].ImageData.Platform.Architecture, "arm64"))
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user