Repository navigation
Handle Swarm-style prefixed container names - #851
Conversation
|
@aanand The current state of Maybe we could embed the node as a |
|
I'd be +1 on using labels; fig/compose and swarm could both add namespaced labels, e.g. |
|
I would love for it to be done with labels, but that would mean blocking on a Docker release. Since it looks very unlikely that labels will make it into the same release that goes out alongside Swarm and Compose, and we want the two to work together on day one (at least in a rudimentary fashion), we're going to need some kind of solution that works now. |
|
Yes, having to wait for Docker to implement it upstream is a blocker. It think implementing the "hacky" way now is the best way to go for the time being. As long as it's clearly mentioned that this is a "technical preview" (or something) and this will change in future (otherwise supporting old installations would become a nightmare). |
|
Well, the existing behaviour (look for a name with a single path component) is already a hack; this is just a slightly different and more permissive hack. Either way, we're going to deprecate it once there's a better way to tag a container with the project and service. My only worry is whether it's fully backwards-compatible, but I think that it is: a container's "primary" name (e.g. |
|
@aanand Have you checked if everything works correctly against this PR: moby/moby#10105 ? |
|
I've been paying attention to that one: it shouldn't be a problem, because the new behaviour will be that only the primary name is returned. I haven't explicitly tested it yet, though. |
|
Ok, thanks, just confirming in case you missed it in the vast amount of PRs and issues. |
|
LGTM |
Signed-off-by: Aanand Prasad <[email protected]>
Signed-off-by: Aanand Prasad <[email protected]>
Signed-off-by: Aanand Prasad <[email protected]>
Handle Swarm-style prefixed container names
Handle Swarm-style prefixed container names Signed-off-by: Yuval Kohavi <[email protected]>
Related to #814.
Swarm prefixes all container names with an extra path component, breaking our name-finding logic when trying to get the "given" name of a container from the output of
/containers/json.The fix: instead of looking for a name with exactly one path component, we pick the shortest one (counting path components of course, not characters) out of the
Namesarray.ping @aluzzardi @vieux - what do you two think of this? Can we do something less hacky?