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

Add conformance test coverage for data field #318

Merged
merged 1 commit into from
Aug 17, 2022

Conversation

imjasonh
Copy link
Member

@imjasonh imjasonh commented Mar 3, 2022

The data proposal was merged: opencontainers/image-spec#826 🎉

This adds some conformance test coverage that the new field is round-trippable through registries, helpfully piggybacking off of #311. Since registries don't validate that the contents match it doesn't seem fair to add that case to conformance, but it's something to consider in the future.

@jdolitsky

Signed-off-by: Jason Hall <jasonhall@redhat.com>
@jdolitsky
Copy link
Member

fire. let me test this out and report back

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.

Tried on Bundle Bar, distribution/distribution, and zot. No failures related to the addition of this field

Copy link
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

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

see nit

@@ -35,6 +35,9 @@ type Descriptor struct {
// Size specifies the size in bytes of the blob.
Size int64 `json:"size"`

// Data specifies the data of the object described by the descriptor.
Data []byte `json:"data"`
Copy link
Member

Choose a reason for hiding this comment

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

from the referenced commit

	// Data is an embedding of the targeted content. This is encoded as a base64
 	// string when marshalled to JSON (automatically, by encoding/json). If
 	// present, Data can be used directly to avoid fetching the targeted content.
 	Data []byte `json:"data,omitempty"`

don't see how Data could be empty from this test bucket.. just a nit...

Copy link
Member Author

Choose a reason for hiding this comment

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

It doesn't even seem to matter either way. An empty []byte with and without the struct tag results in {} in my tests in the Go Playground.

@SteveLasker
Copy link
Contributor

Adding #321 for tracking

@jdolitsky
Copy link
Member

@opencontainers/distribution-spec-maintainers - can we get another +1?

@imjasonh
Copy link
Member Author

Friendly ping.

@vbatts vbatts merged commit dce8d21 into opencontainers:main Aug 17, 2022
@jdolitsky jdolitsky mentioned this pull request Sep 15, 2022
@sudo-bmitch sudo-bmitch mentioned this pull request Feb 1, 2024
8 tasks
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.

5 participants