1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/api/server/router
Yong Tang abf31ee083 Return error in case docker network inspect is ambiguous
This fix is partially based on comment
https://github.com/docker/docker/issues/30242#issuecomment-273517205

Currently, `docker network inspect` relies on `FindNetwork()` which
does not take into consideration that multiple networks with the same
name might exist.

This fix propose to return `docker network inspect` in a similiar
fashion like other commands:
1. Lookup full ID
2. Lookup full name
3. Lookup partial ID
If multiple networks exist, an error will be returned.

NOTE: this fix is not a complete fix for the issue raised in
https://github.com/docker/docker/issues/30242#issuecomment-273517205
where SwarmKit is unable to update when multiple networks with the same
name exit.
To fix that issue requires multiple places when `FindNetwork()` is called.
Because of the impact of changing `FindNetwork()`, this fix focus on
the issue in `docker network inspect`.

A separate PR will be created to address
https://github.com/docker/docker/issues/30242#issuecomment-273517205

An integration test has been added.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2017-02-07 18:05:29 -08:00
..
build Fix processing of unset build-args during build 2016-12-07 07:41:55 -08:00
checkpoint
container Use binary frame for websocket attach endpoint 2017-01-31 14:04:32 -08:00
image Generate ImageDeleteResponse from swagger spec. 2017-01-03 11:47:47 -05:00
network Return error in case docker network inspect is ambiguous 2017-02-07 18:05:29 -08:00
plugin Use distribution reference 2017-02-07 11:08:37 -08:00
swarm change minor mistake of spelling 2016-12-20 21:05:19 +08:00
system rename clusterProvider to cluster in router 2016-12-26 20:53:13 +08:00
volume Convert DanglingOnly to Filters for docker image prune 2016-12-02 20:08:49 -08:00
experimental.go
local.go
router.go