Skip to content

Add conformance test coverage for data field#318

Merged
vbatts merged 1 commit intoopencontainers:mainfrom
imjasonh:data-field
Aug 17, 2022
Merged

Add conformance test coverage for data field#318
vbatts merged 1 commit intoopencontainers:mainfrom
imjasonh:data-field

Conversation

@imjasonh
Copy link
Copy Markdown
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
Copy Markdown
Contributor

fire. let me test this out and report back

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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

Size int64 `json:"size"`

// Data specifies the data of the object described by the descriptor.
Data []byte `json:"data"`
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

Adding #321 for tracking

@jdolitsky
Copy link
Copy Markdown
Contributor

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

@imjasonh
Copy link
Copy Markdown
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