Skip to content

Conversation

@dmcgowan
Copy link
Collaborator

Creates a namespace package and namespace tool. The interface to the namespace package is primarily focused on managing sets of namespace entries which can be used to resolve a name into entries and initialize a registry client.

@stevvooe stevvooe changed the title Namespace package WIP: Namespace package Apr 10, 2015
@stevvooe stevvooe added this to the Registry/2.1 milestone Apr 10, 2015
@dmcgowan dmcgowan force-pushed the namespace-integration branch 4 times, most recently from 241c413 to a16f5cd Compare April 17, 2015 23:02
Copy link

Choose a reason for hiding this comment

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

Think we could move this main() to the top, so it's the first thing after imports?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

agreed, should be on top

@vbatts
Copy link

vbatts commented Apr 30, 2015

what is lacking to get this merged?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Instead of passing in a base set of Entries and a Discoverer, a Discoverer should be able to be composed of multiple discoverers. The base entries should be able to be converted to a discoverer from a static set of entries and composed with any other methods.

@dmcgowan
Copy link
Collaborator Author

dmcgowan commented May 1, 2015

@vbatts

There are still a few more changes I want to make before removing the WIP flag

  • Add composable discoverer, move resolution logic to this discoverer
  • Remove base entries from creating resolver, just use discoverer (add static discoverer which takes in entries)
  • Remove need to import from distribution base package to allow namespace package to stand on its own
    • Remove repository client factory
    • Update resolution interface to only return Endpoint objects (this is all the client needs from Namespace)

@dmcgowan dmcgowan force-pushed the namespace-integration branch 4 times, most recently from 7aa8d6f to b3b1f5b Compare May 5, 2015 01:26
@dmcgowan
Copy link
Collaborator Author

dmcgowan commented May 5, 2015

Made the updates from my previous comment. I need to do one more pass at code cleanup and unit tests then I will remove the WIP tag. I am happy with the current interface although if someone can offer a better name for Entry I would be grateful. I also still think RemoteEndpoint seems off but I am torn because I would prefer the entry argument parsing remain inside the namespace package. Opinions welcome.

@dmcgowan dmcgowan force-pushed the namespace-integration branch from b3b1f5b to 9abfd7a Compare May 5, 2015 15:43
@dmcgowan dmcgowan force-pushed the namespace-integration branch 2 times, most recently from 4fda71c to 59c74f8 Compare May 6, 2015 03:40
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This struct only exists to ensure the underlying entry array is sorted. This keeps inserts and lookups fast. We could get rid of this struct and use functions which mutate and return the Entry slice, but we will lose that guarantee. This entries slice is never actually sorted since inserts are in order.

@dmcgowan dmcgowan force-pushed the namespace-integration branch from d1174c3 to 97fda35 Compare May 6, 2015 15:41
stevvooe and others added 3 commits May 6, 2015 11:13
Signed-off-by: Stephen J Day <stephen.day@docker.com>
Move namespace logic into separate package.  Reduce namespace interface and make use of it from command.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Contains logic was not taking into account the end boundary of the last scope component, allowing for bad matches.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
@dmcgowan dmcgowan force-pushed the namespace-integration branch from 97fda35 to 0083e99 Compare May 6, 2015 18:13
@miminar
Copy link
Contributor

miminar commented May 7, 2015

I've tried to identify gaps between desired feature set and currently proposed state of namespace stuff. The result can be found here.
@dmcgowan, @ncdc, @stevvooe: I'd appreciate if any of you could take a look and comment (probably here). There are few open questions and you may have the answers.

@dmcgowan
Copy link
Collaborator Author

@stevvooe I think I agree that from the namespace resolver perspective, entries should have a scope, action, and arguments. The only entry which would attempt to be resolved is the "namespace" action and only by a particular resolver such as the MultiResolver or a RecursiveResolver.

This is relevant to the http resolver contribution from @minimnar

@stevvooe
Copy link
Collaborator

@miminar I took a peak at the suggested changes. I'm confused as to why you'd add a block command when you can capture and blackhole the namespace:

some.company/      namespace
fully.configured/      namespace
fully.configured/      push ...
fully.configured/      pull ...

In the above example, "some.company/" is has no configuration so it cannot be pushed or pulled. Following from that, I find blocking the entire "endpoint" to be odd when you can simply not include it in the configuration.

These details may not be clear in the specification.

While the confirmation feature seems like a dubious feature, it would probably be better expressed as a modifier for namespace directive:

some.company/      namespace  confirm
some.company/      push  ...

Albeit, it seems odd to express UI behavior at this level. It might be better to have the concept of namespace-less targets, which could be used to push/pull (note the lack of a namespace declaration):

production        push ...
production        pull ...

Then, such and endpoint would require an explicit call out for push:

$ docker push production mysensitivieimage

@miminar
Copy link
Contributor

miminar commented May 19, 2015

@stevvooe You're right about the blocking feature. It wasn't clear enough to me while I wrote those notes.

I like the idea of namespace-less targets. I'll try to come up with more elaborated proposal based on it later.

@stevvooe
Copy link
Collaborator

@miminar Sounds good. We probably need to make these use cases clear in the namespace package docs.

@stevvooe
Copy link
Collaborator

stevvooe commented Jan 7, 2016

We are reevaluating the approach here. Closing this for now.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants