Skip to content
This repository was archived by the owner on May 15, 2024. It is now read-only.

add go specs for artifact manifest - #17

Merged
SteveLasker merged 3 commits into
oras-project:mainfrom
aviral26:specs
Aug 20, 2021
Merged

SteveLasker merged 3 commits into
oras-project:mainfrom
aviral26:specs

Conversation

@aviral26

Copy link
Copy Markdown
Contributor

This PR adds Go specs for ORAS Artifact manifest. Addresses #15.

Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>
Comment thread specs-go/v1/mediatype.go Outdated

@SteveLasker SteveLasker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM with the minor, but important change on the MediaTypeArtifactManifest

Comment thread specs-go/v1/mediatype.go Outdated
Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>
@aviral26
aviral26 requested a review from SteveLasker August 19, 2021 06:55

@SteveLasker SteveLasker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some additional questions on why we need dependencies to the image-spec

Comment thread go.mod Outdated
Comment thread go.sum Outdated
Comment thread specs-go/v1/manifest.go Outdated

package v1

import v1 "github.com/opencontainers/image-spec/specs-go/v1"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

where/;why?

@sajayantony sajayantony Aug 19, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems correct to me - Artifact-spec doesn’t need to redefine the standard descriptor.
see line 32.
SubjectManifest v1.Descriptor json:"subjectManifest"

@SteveLasker SteveLasker Aug 19, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actually, this is the purpose fo the artifact-descriptor as it adds the artifactType property, and is a superset of the image-spec-descriptor.

@sajayantony sajayantony Aug 19, 2021

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would ideally not like to redefine structures that have already been well defined in other locations in projects we typically are comfortable taking dependency on. After discussions with @SteveLasker I think its important to call out this specific case which is that these are only spec files and image-spec repo is a subset of OCI which is more about container images (or process containers) and there is no reason for client library which wants to deal with signatures need to bring in image-spec into its modules as an indirect dependency.

The descriptor if at all there was should come from distribution-spec but since that is also not solidified and is under a different body (OCI) it is ok to just use the artifactDescriptor for both blobs and subjectManifest since the annotation fields are optional and anyone building clients don't have indirect deps on image-spec

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

and is a superset of the image-spec-descriptor.

If it's intended to be a superset of the image-spec descriptor, you have a logical dependency on image-spec. If you're intending to fork the image-spec descriptor, that's fine, but it's not really a superset anymore if they can diverge.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

but it's not really a superset anymore if they can diverge.

That's fair. It's a superset of what's defined in the 1.0 of the image-spec. Having it defined in the artifacts-spec, or preferably in the distribution-spec would be to allow the image-spec maintainers to evolve the image-spec as they want without destabilizing artifacts-manifest consumers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

So as artifact descriptors, blobs and subjectManifest properties will not support annotations?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Please see #21

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the dependency on image-spec.

remove dependency on opencontainers/image-spec by defining a descriptor

Signed-off-by: Aviral Takkar <aviral26@users.noreply.github.com>

@SteveLasker SteveLasker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants