Skip to content

Commit 0173950

Browse files
committed
Also support manifest lists
(used by docker apps) Signed-off-by: Nicolas De Loof <[email protected]>
1 parent a711cf7 commit 0173950

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

manifest_test.go

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,26 @@ func TestManifestV1(t *testing.T) {
3030
}
3131
}
3232

33+
func TestManifestList(t *testing.T) {
34+
out, err := run("manifest", "docker.io/ndeloof/hello-app")
35+
if err != nil {
36+
t.Fatalf("output: %s, error: %v", out, err)
37+
}
38+
39+
expected := `"schemaVersion": 2,`
40+
if !strings.Contains(out, expected) {
41+
t.Fatalf("expected: %s\ngot: %s", expected, out)
42+
}
43+
}
44+
3345
func TestManifestWithHubDomain(t *testing.T) {
3446
// Regression test for https://github.com/genuinetools/reg/issues/164
3547
out, err := run("manifest", "busybox")
3648
if err != nil {
3749
t.Fatalf("output: %s, error: %v", out, err)
3850
}
3951

40-
expected := `"schemaVersion": 2,`
52+
expected := `"schemaVersion": 2`
4153
if !strings.Contains(out, expected) {
4254
t.Fatalf("expected: %s\ngot: %s", expected, out)
4355
}

registry/manifest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (r *Registry) Manifest(ctx context.Context, repository, ref string) (distri
2929
return nil, err
3030
}
3131

32-
req.Header.Add("Accept", schema2.MediaTypeManifest)
32+
req.Header.Add("Accept", schema2.MediaTypeManifest+", "+manifestlist.MediaTypeManifestList)
3333

3434
resp, err := r.Client.Do(req.WithContext(ctx))
3535
if err != nil {

0 commit comments

Comments
 (0)