8000 Manifest interface refactor by RichardScothern · Pull Request #1105 · distribution/distribution · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Manifest interface refactor #1105

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

Closed

Conversation

RichardScothern
Copy link

Carry @stevvooe's branch to refactor Manifest interfaces within the registry.

Add a generic Manifest interface to represent manifests in the registry.

Add a ManifestBuilder to construct Manifest objects. Concrete manifest builders
will exist for each manifest type and implementations will contain manifest
specific data used to build a manifest.

Move tag functionality to a seperate TagService and update ManifestService
to use the new interfaces.

Signature functionality will be retained for backwards compatibility, but isn't
represented in this change. All signature related code for Schema1 V2 manifest
will exists in a specific SignedManifestStore implementation (not shown).

Signed-off-by: Richard Scothern richard.scothern@gmail.com

…egistry.

Add a generic Manifest interface to represent manifests in the registry.

Add a ManifestBuilder to construct Manifest objects.  Concrete manifest builders
will exist for each manifest type and implementations will contain manifest
specific data used to build a manifest.

Move tag functionality to a seperate TagService and update ManifestService
to use the new interfaces.

Signature functionality will be retained for backwards compatibility, but isn't
represented in this change.  All signature related code for Schema1 V2 manifest
will exists in a specific SignedManifestStore implementation (not shown).

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
distribution APIs.

Remove Maniest.Tags()

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
// Constituents returns a list of objects which make up this manifest.
// The dependencies are strictly ordered from base to head. A constituent
// is anything which can be represented by a distribution.Descriptor
Constituents() []Descriptor
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why Constituents and not Dependencies? /mostly curious

Copy link
Author

Choose a reason for hiding this comment

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

I wasn't sure Dependencies really captured the right meaning as it implied to me something external to this object. Constituents is more accurate, but I'm not thrilled with the word (I also considered objects and references). I was hoping for a minor bikeshed over this one: @dmcgowan @aaronlehmann

Copy link
Collaborator

Choose a reason for hiding this comment

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

Sweet! 🚲 🏡 initiated! <bikeshedding music plays, mostly death metal cause its going to be brutal!> 🎸 🚲 🏡 🎸

I like References. I think that captures the intent.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I am also not a fan of the name, but if it remains unchanged this will be the last I say about it 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, I don't think Dependencies is the right term.

Copy link
Author

Choose a reason for hiding this comment

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

OK. 2 votes for References. Any more takers?

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍 for References

@stevvooe
Copy link
Collaborator

LGTM!

@dmcgowan
Copy link
Collaborator

LGTM

type Manifest interface {
// Target returns a descriptor for the configuration of this manifest. This
// may return a nil descriptor if none exists for this manifest.
Target() Descriptor
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this return nil for old-style manifests? If so, shouldn't it be part of a more specific interface?

Copy link
Author

Choose a reason for hiding this comment

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

I did consider this, but didn't want to fragment the interfa 8000 ce.

Perhaps more explicit return types (e.g. returning ErrNotSupported) would work here.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm... I don't want to make a big deal out of it, but it doesn't seem right to me to have a method in an interface that's specific to one of the implementations. What do others think?

Copy link
Collaborator

Choose a reason for hiding this comment

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

The target should just be the manifest itself.

Add method for getting tags for a digest.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
)

// TagService provides access to information about tagged objects.
type TagService interface {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this scoped to a global namespace or particular repository or both?

Copy link
Author

Choose a reason for hiding this comment

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

Currently a repository returns an instance to its tag service. In the future there will be a tag service. docker notary for instance.

@RichardScothern
Copy link
Author

Closing. Included in #1268

@RichardScothern RichardScothern deleted the manifest-refactor branch February 5, 2016 18:30
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.

7 participants
0