-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Service creation with duplicate network name on different scopes (one in local and one in swarm) #167
Labels
Comments
This was referenced Jun 8, 2017
Are you proposing to add a parameter to service inspect that allows the user to specify which scope they are inspecting? I think that sounds good. |
yongtang
added a commit
to yongtang/docker
that referenced
this issue
Jun 12, 2017
This fix tries to add a `scope` in the query of `/networks/<id>` (`NetworkInspect`) so that in case of duplicate network names, it is possible to locate the network ID based on the network scope (`local`, 'swarm', or `global`). Multiple networks might exist in different scopes, which is a legitimate case. For example, a network name `foo` might exists locally and in swarm network. However, before this PR it was not possible to query a network name `foo` in a specific scope like swarm. This fix fixes the issue by allowing a `scope` query in `/networks/<id>`. Additional test cases have been added to unit tests and integration tests. This fix is related to docker/cli#167, moby#30897, moby#33561, moby#30242 This fix fixes docker/cli#167 Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
andrewhsu
pushed a commit
to docker-archive/docker-ce
that referenced
this issue
Jun 24, 2017
This fix updates docker/docker to 4310f7d This fix is related to moby/moby#33630 and docker/cli#167 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 8c2f81892beb7634a97efeec053f7052c36b4039 Component: cli
andrewhsu
pushed a commit
to docker-archive/docker-ce
that referenced
this issue
Jun 24, 2017
This fix use `scope=swarm` for service related network inspect. The purpose is that, in case multiple networks with the same name exist in different scopes, it is still possible to obtain the network for services. This fix is related to moby/moby#33630 and docker/cli#167 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 657457ee2cc1b4ced804674ad1b3bfe19b849f31 Component: cli
silvin-lubecki
pushed a commit
to silvin-lubecki/engine-extract
that referenced
this issue
Mar 16, 2020
This fix tries to add a `scope` in the query of `/networks/<id>` (`NetworkInspect`) so that in case of duplicate network names, it is possible to locate the network ID based on the network scope (`local`, 'swarm', or `global`). Multiple networks might exist in different scopes, which is a legitimate case. For example, a network name `foo` might exists locally and in swarm network. However, before this PR it was not possible to query a network name `foo` in a specific scope like swarm. This fix fixes the issue by allowing a `scope` query in `/networks/<id>`. Additional test cases have been added to unit tests and integration tests. This fix is related to docker/cli#167, moby/moby#30897, moby/moby#33561, moby/moby#30242 This fix fixes docker/cli#167 Signed-off-by: Yong Tang <yong.tang.github@outlook.com> Upstream-commit: 158b2a1 Component: engine
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
In command line
docker service create
, the network name is now converted to network ID then passed to daemon (vs. done in the daemon previously):cli/cli/command/service/opts.go
Lines 348 to 360 in ab3ea63
However, as
convertNetworks
usesinspect
to do the network name conversion, a duplication error would be returned in case there are multiple network IDs available for the same network name.In certain situations, it might be possible that there are multiple networks with the same name but with different scope, e.g, one
foo
in local and onefoo
in swarm.For that I think it makes sense to change the way
convertNetworks
is done so that only networks related to swarm scope are searched.Additional information you deem important (e.g. issue happens only occasionally):
This issue may need to be resolved in order to eventually fix network duplication issue in moby/moby/pull/30897 , moby/moby/issues/33561, moby/moby/issues/30242
The text was updated successfully, but these errors were encountered: