From b1f849ffca4954a644f574c7c25fd967c31362b8 Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Mon, 1 Aug 2022 14:08:04 -0500 Subject: [PATCH] Temporarily remove conformance changes Signed-off-by: Josh Dolitsky --- conformance/03_discovery_test.go | 55 ++++++++------------------------ conformance/image.go | 3 -- conformance/setup.go | 9 ------ 3 files changed, 13 insertions(+), 54 deletions(-) diff --git a/conformance/03_discovery_test.go b/conformance/03_discovery_test.go index abd9b3e5..66d66430 100644 --- a/conformance/03_discovery_test.go +++ b/conformance/03_discovery_test.go @@ -19,37 +19,17 @@ var test03ContentDiscovery = func() { var tagList []string g.Context("Setup", func() { - g.Specify("Populate registry with test blobs", func() { - SkipIfDisabled(contentDiscovery) - RunOnlyIf(runContentDiscoverySetup) - for i := 1; i <= 2; i++ { - req := client.NewRequest(reggie.POST, "/v2//blobs/uploads/") - resp, err := client.Do(req) - Expect(err).To(BeNil()) - req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()). - SetQueryParam("digest", configs[i].Digest). - SetHeader("Content-Type", "application/octet-stream"). - SetHeader("Content-Length", configs[i].ContentLength). - SetBody(configs[i].Content) - resp, err = client.Do(req) - Expect(err).To(BeNil()) - Expect(resp.StatusCode()).To(SatisfyAll( - BeNumerically(">=", 200), - BeNumerically("<", 300))) - } - }) - - g.Specify("Populate registry with test layer", func() { + g.Specify("Populate registry with test blob", func() { SkipIfDisabled(contentDiscovery) RunOnlyIf(runContentDiscoverySetup) req := client.NewRequest(reggie.POST, "/v2//blobs/uploads/") resp, err := client.Do(req) Expect(err).To(BeNil()) req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()). - SetQueryParam("digest", layerBlobDigest). + SetQueryParam("digest", configs[2].Digest). SetHeader("Content-Type", "application/octet-stream"). - SetHeader("Content-Length", layerBlobContentLength). - SetBody(layerBlobData) + SetHeader("Content-Length", configs[2].ContentLength). + SetBody(configs[2].Content) resp, err = client.Do(req) Expect(err).To(BeNil()) Expect(resp.StatusCode()).To(SatisfyAll( @@ -57,15 +37,19 @@ var test03ContentDiscovery = func() { BeNumerically("<", 300))) }) - g.Specify("Populate registry with referred-to manifest", func() { + g.Specify("Populate registry with test layer", func() { SkipIfDisabled(contentDiscovery) RunOnlyIf(runContentDiscoverySetup) - req := client.NewRequest(reggie.PUT, "/v2//manifests/", - reggie.WithReference("test-something-points-to-me")). - SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json"). - SetBody(manifests[1].Content) + req := client.NewRequest(reggie.POST, "/v2//blobs/uploads/") resp, err := client.Do(req) Expect(err).To(BeNil()) + req = client.NewRequest(reggie.PUT, resp.GetRelativeLocation()). + SetQueryParam("digest", layerBlobDigest). + SetHeader("Content-Type", "application/octet-stream"). + SetHeader("Content-Length", layerBlobContentLength). + SetBody(layerBlobData) + resp, err = client.Do(req) + Expect(err).To(BeNil()) Expect(resp.StatusCode()).To(SatisfyAll( BeNumerically(">=", 200), BeNumerically("<", 300))) @@ -141,19 +125,6 @@ var test03ContentDiscovery = func() { Expect(len(tagList)).To(BeNumerically("<=", numResults)) Expect(tagList).To(ContainElement(tagList[numResults-1])) }) - - g.Specify("GET request to list of referrers should yield 200 response", func() { - SkipIfDisabled(contentDiscovery) - // TODO: should move to this form per the spec, - // the endpoint used is supported currently by oci-playground/distribution - // req := client.NewRequest(reggie.GET, "/v2//referrers/", reggie.WithDigest(manifests[2].Digest)) - req := client.NewRequest(reggie.GET, "/v2//_oci/artifacts/referrers") - // set the digest to the one being pointed to by manifests[2] - req.QueryParam.Add("digest", manifests[1].Digest) - resp, err := client.Do(req) - Expect(err).To(BeNil()) - Expect(resp.StatusCode()).To(Equal(http.StatusOK)) - }) }) g.Context("Teardown", func() { diff --git a/conformance/image.go b/conformance/image.go index d6868802..1a0600a7 100644 --- a/conformance/image.go +++ b/conformance/image.go @@ -20,9 +20,6 @@ type Manifest struct { // Layers is an indexed list of layers referenced by the manifest. Layers []Descriptor `json:"layers"` - - // Refers links a manifest to another existing manifest. - Refers *Descriptor `json:"refers,omitempty"` } // Descriptor describes the disposition of targeted content. diff --git a/conformance/setup.go b/conformance/setup.go index 39ae7fbe..95e801bb 100644 --- a/conformance/setup.go +++ b/conformance/setup.go @@ -234,15 +234,6 @@ func init() { } manifest.SchemaVersion = 2 - // except for the first one, add "refers" field pointing to the last one - if i > 0 { - manifest.Refers = &Descriptor{ - MediaType: "application/vnd.oci.image.manifest.v1+json", - Digest: godigest.Digest(manifests[i-1].Digest), - Size: int64(len(manifests[i-1].Content)), - } - } - manifestContent, err := json.MarshalIndent(&manifest, "", "\t") if err != nil { log.Fatal(err)