diff --git a/conformance/01_pull_test.go b/conformance/01_pull_test.go index ead00b69..d0097d52 100644 --- a/conformance/01_pull_test.go +++ b/conformance/01_pull_test.go @@ -72,7 +72,7 @@ var test01Pull = func() { g.Specify("Populate registry with test manifest", func() { SkipIfDisabled(pull) RunOnlyIf(runPullSetup) - tag := testTagName + tag = testTagName req := client.NewRequest(reggie.PUT, "/v2//manifests/", reggie.WithReference(tag)). SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json"). @@ -98,26 +98,13 @@ var test01Pull = func() { BeNumerically("<", 300))) }) - g.Specify("Get the name of a tag", func() { - SkipIfDisabled(pull) - RunOnlyIf(runPullSetup) - req := client.NewRequest(reggie.GET, "/v2//tags/list") - resp, err := client.Do(req) - Expect(err).To(BeNil()) - tag = getTagNameFromResponse(resp) - - // attempt to forcibly overwrite this tag with the unique manifest for this run - req = client.NewRequest(reggie.PUT, "/v2//manifests/", - reggie.WithReference(tag)). - SetHeader("Content-Type", "application/vnd.oci.image.manifest.v1+json"). - SetBody(manifests[0].Content) - _, _ = client.Do(req) - }) - g.Specify("Get tag name from environment", func() { SkipIfDisabled(pull) RunOnlyIfNot(runPullSetup) - tag = os.Getenv(envVarTagName) + tmp := os.Getenv(envVarTagName) + if tmp != "" { + tag = tmp + } }) }) diff --git a/conformance/setup.go b/conformance/setup.go index 50ff4c81..350369aa 100644 --- a/conformance/setup.go +++ b/conformance/setup.go @@ -624,19 +624,6 @@ func getTagList(resp *reggie.Response) []string { return tagList.Tags } -func getTagNameFromResponse(lastResponse *reggie.Response) (tagName string) { - tl := &TagList{} - if lastResponse != nil { - jsonData := lastResponse.Body() - err := json.Unmarshal(jsonData, tl) - if err == nil && len(tl.Tags) > 0 { - tagName = tl.Tags[0] - } - } - - return -} - // Adapted from https://gist.github.com/dopey/c69559607800d2f2f90b1b1ed4e550fb func randomString(n int) string { const letters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-"