Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conformance tests: delete emptylayer manifest too #307

Closed
wants to merge 2 commits into from
Closed

Conformance tests: delete emptylayer manifest too #307

wants to merge 2 commits into from

Conversation

edigaryev
Copy link

Otherwise the Delete config blob created in tests step will fail (even when using OCI_DELETE_MANIFEST_BEFORE_BLOBS=1), because the configuration blob that it deletes is also referenced by the emptylayer manifest:

emptyLayerManifest := imagespec.Manifest{
Config: imagespec.Descriptor{
MediaType: "application/vnd.oci.image.config.v1+json",
Digest: godigest.Digest(configs[1].Digest),
Size: int64(len(configs[1].Content)),
},
Layers: []imagespec.Descriptor{},
}

Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
Copy link
Member

@jdolitsky jdolitsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ran this changeset against bundlebar, and failing with:

~~~ RESPONSE ~~~
STATUS       : 400 Bad Request
RECEIVED AT  : 2021-12-01T11:05:28.706046-06:00
TIME DURATION: 31.481292ms
HEADERS      :
	Connection: keep-alive
	Content-Length: 94
	Content-Type: application/json; charset=utf-8
	Date: Wed, 01 Dec 2021 17:05:28 GMT
	Server: bundle.bar
	X-Content-Type-Options: nosniff
	X-Request-Id: 778b424b-7721-46ef-9b29-7554206e500d
BODY         :
{
   "errors": [
      {
         "code": "UNSUPPORTED",
         "message": "deletion by tag is not supported",
         "detail": null
      }
   ]
}

I beilieve we need to allow that if the delete by tag returns 400, it is a UNSUPPORTED error.

Similar to what is done in lines 97-102 here:

if resp.StatusCode() == http.StatusBadRequest {

To work around spec's manifest by tag deletion being optional.

Signed-off-by: Nikolay Edigaryev <edigaryev@gmail.com>
@edigaryev
Copy link
Author

I beilieve we need to allow that if the delete by tag returns 400, it is a UNSUPPORTED error.

It seems like a more appropriate solution would be to delete that manifest by a digest, because we still want it to be gone to be free of dependencies, see 40b4c03.

Also, what is a "bundlebar" and how can I run the conformance tests against it?

@edigaryev
Copy link
Author

@jdolitsky would you mind giving this a look once more? Thanks!

@jdolitsky jdolitsky added this to the v1.1.0 milestone Feb 17, 2022
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +349 to +350
deleteManifest(client.NewRequest(reggie.DELETE, "/v2/<name>/manifests/<digest>",
reggie.WithDigest(emptyLayerManifestDigest)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need a condition on this second delete, checking whether skipEmptyLayerTest is false before running it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #421 for while this will be a bigger issue going forward.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have fixed this in #421 since hitting this issue there as well.

@@ -330,21 +330,28 @@ var test02Push = func() {
})

g.Context("Teardown", func() {
deleteManifest := func(req *reggie.Request) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not move this into setup.go or a utils.go/common.go
Other tests could use this too.

@jdolitsky
Copy link
Member

closing as outdated, will address as we make further updates in conformance in the coming ~ week

@jdolitsky jdolitsky closed this Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants