(t *testing.T)
| 598 | } |
| 599 | |
| 600 | func TestTransferImport(t *testing.T) { |
| 601 | ctx, cancel := testContext(t) |
| 602 | defer cancel() |
| 603 | |
| 604 | client, err := newClient(t, address) |
| 605 | if err != nil { |
| 606 | t.Fatal(err) |
| 607 | } |
| 608 | defer client.Close() |
| 609 | |
| 610 | for _, testCase := range []struct { |
| 611 | // Name is the name of the test |
| 612 | Name string |
| 613 | |
| 614 | // Images is the names of the images to create |
| 615 | // [0]: Index name or "" |
| 616 | // [1:]: Additional images and manifest to import |
| 617 | // Images ending with @<manifest> will have the digest of the previously imported manifest appended |
| 618 | // Images ending with @<index> will have the index digest appended |
| 619 | // A space can be used to separate a repo name and tag, only the tag will be set in the imported image |
| 620 | Images []string |
| 621 | Opts []image.StoreOpt |
| 622 | }{ |
| 623 | { |
| 624 | Name: "Basic", |
| 625 | Images: []string{"", "registry.test/basic:latest"}, |
| 626 | Opts: []image.StoreOpt{image.WithNamedPrefix("unused", true)}, |
| 627 | }, |
| 628 | { |
| 629 | Name: "IndexRef", |
| 630 | Images: []string{"registry.test/index-ref:latest", ""}, |
| 631 | }, |
| 632 | { |
| 633 | Name: "AllRefs", |
| 634 | Images: []string{"registry.test/all-refs:index", "registry.test/all-refs:1"}, |
| 635 | Opts: []image.StoreOpt{image.WithNamedPrefix("registry.test/all-refs", false)}, |
| 636 | }, |
| 637 | { |
| 638 | Name: "DigestRefs", |
| 639 | Images: []string{"registry.test/all-refs:index", "registry.test/all-refs:1", "registry.test/all-refs@<manifest>", "registry.test/all-refs@<index>"}, |
| 640 | Opts: []image.StoreOpt{image.WithDigestRef("registry.test/all-refs", false, false)}, |
| 641 | }, |
| 642 | { |
| 643 | Name: "DigestRefsSkipNamed", |
| 644 | Images: []string{"registry.test/all-refs:index", "registry.test/all-refs:1", "registry.test/all-refs@<index>"}, |
| 645 | Opts: []image.StoreOpt{image.WithDigestRef("registry.test/all-refs", false, true)}, |
| 646 | }, |
| 647 | { |
| 648 | Name: "DigestOnly", |
| 649 | Images: []string{"", "", "imported-image@<manifest>", "imported-image@<index>"}, |
| 650 | Opts: []image.StoreOpt{image.WithDigestRef("imported-image", false, true)}, |
| 651 | }, |
| 652 | { |
| 653 | Name: "OverwriteDigestRefs", |
| 654 | Images: []string{"registry.test/all-refs:index", "registry.test/all-refs:1", "someimportname@<manifest>", "someimportname@<index>"}, |
| 655 | Opts: []image.StoreOpt{image.WithDigestRef("someimportname", true, false)}, |
| 656 | }, |
| 657 | { |
nothing calls this directly
no test coverage detected
searching dependent graphs…