1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

28 commits

Author SHA1 Message Date
Chun Chen
59e1e42ce7 Add tests for internal network
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-12-22 09:31:50 +08:00
Madhu Venugopal
e8370e78d0 Changed Labels to DriverOpts
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-14 16:38:46 -07:00
Madhu Venugopal
bd45253fb5 move Labels from array to map to be consistent with cotnainers
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-09 11:08:13 -07:00
Alessandro Boch
2401496d2a Enable network labels in Rest API
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 01:06:20 -07:00
Madhu Venugopal
a42e5f0663 Flip the default for the flag AllowNonDefaultBridge in bridge driver
Replaced it with DisableBridgeCreation and it can be used ONLY in
a special case for docker0 bridge from docker, instead of calling it
from all other case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-24 02:18:35 -07:00
Jana Radhakrishnan
0e00550af4 Merge pull request #502 from mavenugo/sbox_uns
Support to provide external key to sandbox
2015-09-09 21:39:48 -07:00
Madhu Venugopal
f59502e1bd Support to provide external key to sandbox
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-09 20:26:37 -07:00
Toshiaki Makita
af323c7006 Don't discard error message on sending response
Error messages are always discarded and it makes diagnostic difficult
when error occurs.

Before:
$ dnet network create -d overlay ov1
error : ""
$ docker network create -d overlay ov1
Error response from daemon: ""

After:
$ dnet network create -d overlay ov1
error : "no datastore configured. cannot obtain vxlan id"
$ docker network create -d overlay ov1
Error response from daemon: "no datastore configured. cannot obtain vxlan id"

Breakage caused by  11094f2

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-09-02 16:15:14 -07:00
Alessandro Boch
fd43ee1323 Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00
Alessandro Boch
11094f2645 Pass proper regex to mux for query fields
- So that it will not discard empty query fields

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-16 00:22:34 -07:00
Madhu Venugopal
04e96f3811 workaround to a minor bug in mux which filters out empty query
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-15 01:25:45 -07:00
Madhu Venugopal
03504cab65 Few changes to the UI and API implementation
1. replaced --net option for service UI with SERVICE.[NETWORK] format
2. Making using of the default network/driver backend support
3. NetworkName and NetworkType from the UI/API can be empty string
   and it will be replaced with DefaultNetwork and DefaultDriver

As per the design goals, we wanted to keep libnetwork core free of
handling defaults. Rather, the clients (docker & dnet) must handle the
defaultness of these entities.
Also, since there is no API to get these Default values from the
backend, UI will not handle the default values either. Hence, this falls
under the responsibility of the API layer to handle this specific case.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-14 21:57:18 -07:00
Alessandro Boch
7de9f71eb5 Promote Service cli
- To the same level of Network cli
  and to make use of the new service
  rest apis

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-11 16:07:09 -07:00
Alessandro Boch
0912ecfc05 Add Service hierarchy to rest api
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-11 15:46:45 -07:00
Jana Radhakrishnan
800029abb6 Remove container data return value from Join
Now that Endpoint interface has the Info method there is no
need to return container data as a return value in the Join
method. Removed the return value and fixed all the callers.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-29 20:11:02 +00:00
Madhu Venugopal
e20e7bbbfe Added API support for both /vx.x/networks & /networks
In one of the previous commit, we went to the extreme of supporting just
the /{version}/networks. Though that satisfied the requirements for UI
integration, it is not fully consistent with Docker APIs.
Docker API supports both /{version}/resource and /resource and hence we
must add the same support for networks resource.

Also fixed a silly bug in api.go

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-24 15:17:47 -07:00
Alessandro Boch
5d9c59e523 Support network options in rest api
- Also unexporting configuration structures in bridge
- Changes in dnet/network.go to set bridge name = network name

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-23 20:12:29 -07:00
Madhu Venugopal
a1c3dce3e9 Added a catch-all root hierarchy for the API path
Though libnetwork api is supposed to handle the sub router, it is given
the entire URL to deal with. But the current api.go assumes the network/
to be in the root path.
We need this patch to make it work seamlessly with docker & dnet UI & API

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-23 12:20:30 -07:00
Madhu Venugopal
b5a6c849e3 Adding support for network/id/endpoints in api
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-22 09:53:19 -07:00
Alessandro Boch
e97b1e05a8 REST API: Support query by partial id
- for networks and endpoints

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-21 14:37:21 -07:00
Jana Radhakrishnan
956fd3f679 Merge pull request #163 from aboch/eorr
Provide interface to categorize errors
2015-05-21 09:09:15 -07:00
Alessandro Boch
c70cfcb150 Provide interface to categorize errors
- Package types to define the interfaces libnetwork errors
  may implement, so that caller can categorize them.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 22:29:29 -07:00
Alessandro Boch
7d80a5a84a Changes in rest api
- Fix POST to collection
- Only resource ID in URI, search by name as query parameter
- Fix URLs, consistency and restrict regex

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-20 16:44:06 -07:00
Madhu Venugopal
977fcdd952 Client to make use of REST API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:30 -07:00
Jana Radhakrishnan
b323d571b5 Driver api refactor
Refactored the driver api so that is aligns well with the design
of endpoint lifecycle becoming decoupled from the container lifecycle.
Introduced go interfaces to obtain address information during CreateEndpoint.
Go interfaces are also used to get data from driver during join.
This sort of deisgn hides the libnetwork specific type details from drivers.

Another adjustment is to provide a list of interfaces during CreateEndpoint. The
goal of this is many-fold:
     * To indicate to the driver that IP address has been assigned by some other
       entity (like a user wanting to use their own static IP for an endpoint/container)
       and asking the driver to honor this. Driver may reject this configuration
       and return an error but it may not try to allocate an IP address and override
       the passed one.
     * To indicate to the driver that IP address has already been allocated once
       for this endpoint by an instance of the same driver in some docker host
       in the cluster and this is merely a notification about that endpoint and the
       allocated resources.
     * In case the list of interfaces is empty the driver is required to allocate and
       assign IP addresses for this endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-18 22:36:00 +00:00
junxu
4aa71f337c Fix misuse urlNwName and urlNwID in api.
Signed-off-by: junxu <xujun@cmss.chinamobile.com>
2015-05-18 02:49:10 +00:00
Alessandro Boch
1e91009978 Network and Endpoint query methods to return error on not found
- As requested by Docker committers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-15 16:18:04 -07:00
Alessandro Boch
9fad1812d9 Initial libnetwork rest api
- Defines and implement http handler for "/networks" URLs
- Addresses part of requirements tracked by Issue #5

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-14 12:18:44 -07:00