Commit graph

408 commits

Author SHA1 Message Date
Madhu Venugopal
0fda541b37 Updating to new Swarm discovery and store APIs
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
a14da7ba36 Updating to latest Swarm dependancies
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Jana Radhakrishnan
54b1d35adf Merge pull request #273 from mavenugo/delete_restore
handling error condition for network and endpoint deletes
2015-06-10 19:54:44 -07:00
Madhu Venugopal
fc9b204f39 handling error condition for network and endpoint deletes
Unless it is a forbidden error, libnetwork should not fail a forced
delete of a network and endpoint if the driver throws an error.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 16:21:46 -07:00
Madhu Venugopal
2dcc09a8ef Merge pull request #272 from estesp/gc-startup-fix
Check GC loop is active/necessary before triggering GC
2015-06-10 14:08:37 -07:00
Phil Estes
6628cf7f5a Check GC loop is active/necessary before triggering GC
Calling GC() without ever creating a network namespace (sandbox on
Linux) will hang as the GC loop is not running (and therefore the
channel is not being listened to).

Tested via Docker that this corrects a daemon shutdown error if the
daemon is started and stopped without any containers or networks being
created while the daemon is up.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2015-06-10 16:43:31 -04:00
Madhu Venugopal
6e86aa6ca6 Merge pull request #267 from aboch/cp
Minor changes in bridge.go
2015-06-09 17:30:42 -07:00
Alessandro Boch
8d7e5cbb68 Minor changes in bridge.go
- lock network struct before accessing config in NetworkCreate
- reorganize locks so that we lock only what needed and when needed
- conflict method really belongs to networkConfig not bridgeNetwork

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-09 16:44:43 -07:00
aboch
98b6a1448c Merge pull request #266 from mavenugo/master
Moved services to dnet top-level and removed experimental
2015-06-08 19:14:29 -07:00
Madhu Venugopal
57fa550791 Merge pull request #250 from aboch/ni
Provide isolation b/w bridge networks
2015-06-08 18:58:15 -07:00
Alessandro Boch
e27586de4e Provide isolation b/w bridge networks
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-08 17:15:57 -07:00
Madhu Venugopal
a0cccbbcfa Moved services to dnet top-level and removed experimental
In prep for the UI/API updates on Docker to integrate the network and
endpoints, this PR removes the experimental tag from dnet and moving it
to docker UI and API and wrap the top-level "network" and "service"
under experimental.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-08 14:23:41 -07:00
aboch
d861b7ec70 Merge pull request #257 from mrjana/overlay
Refactor sandbox code to use interfaces and add bridge support to sandbox
2015-06-08 14:05:59 -07:00
Madhu Venugopal
704da9d865 Merge pull request #265 from Microsoft/10662-compileagain
Windows: Allow compilation (again)
2015-06-08 11:27:44 -07:00
John Howard
fa22255b2d Windows: Allow compilation (again)
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-06-08 11:12:56 -07:00
Jana Radhakrishnan
4ceec05f1b Add support to add bridge to the sandbox.
Added support to add a bridge the same way as any other
interface into the namespace. The only difference is linux
does not support creating the bridge in one namespace and
moving it into another namespace. So for a bridge the sandbox
code also does the creation of the bridge inside the sandbox.
Also added an optional argument to interface which can now
select one of the already existing interfaces as it's master.
For this option to succeed the master interface should be of type
bridge.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 10:21:00 -07:00
Jana Radhakrishnan
f5c1c78179 Refactor sandbox code to use interfaces
Currently sandbox code exposes bare structs
externally to the package. It is untenable
to continue this way and it becomes too
inflexible to use it to store internal state.
Changed all of them to use interfaces.
Also cleaned up a lot of boiler plate code
which needs to set into namespace.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 10:17:56 -07:00
Jana Radhakrishnan
6d6aeff780 Make GenerateIfaceName generic
Currently GenerateIfaceName is defined in bridge.go
and it specifically tries to only generate an interface
name only with `veth` prefix. Make it generic so that it
can accept a prefix and length of random bytes. Also
move it to netutils since it is useful to generate various
kinds of interface names using it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-08 09:49:17 -07:00
Jana Radhakrishnan
5f53eaf5a7 Merge pull request #252 from aboch/rm
Add restrictions for default drivers/bridge name
2015-06-08 08:38:06 -07:00
Alessandro Boch
8ac0d7709f Add restrictions for default drivers/bridge name
- modified tests accordingly
- added extra tests for creating a couple of bridge nw and query them

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-08 08:32:08 -07:00
Madhu Venugopal
48374f367f Merge pull request #262 from mrjana/cnm_integ
Add support to trigger immediate garbage collection
2015-06-05 14:21:35 -07:00
Jana Radhakrishnan
15ddc3717a Add support to trigger immediate garbage collection
Right now the namespace paths are cleaned up every
garbage collection period. But if the daemon is restarted
before all the namespace paths of removed containers are
garbage collected they will remain there forever. The fix
is to provide a GC() api so that garbage collection can be
triggered immediately.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-05 14:15:29 -07:00
Madhu Venugopal
ba873e7862 Merge pull request #258 from bpradipt/ppc64le-netns-fix
Update netns to include support for PowerPC LE (ppc64le) architecture
2015-06-05 11:34:51 -07:00
Jana Radhakrishnan
dbc025117d Merge pull request #192 from squaremo/remote_driver_docs
Document the remote driver protocol
2015-06-05 08:54:31 -07:00
Jana Radhakrishnan
638498aedb Merge pull request #259 from kvasdopil/freebsd-compile-new
make libnetwork compile on freebsd
2015-06-05 08:47:40 -07:00
Alexey Guskov
f770d4b448 make libnetwork compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
2015-06-05 14:27:23 +03:00
Michael Bridgen
65519600f0 Document the remote driver protocol
And some minor updates to the preceding text.

Signed-off-by: Michael Bridgen <mikeb@squaremobius.net>
2015-06-05 12:18:50 +01:00
Pradipta Kr. Banerjee
71f08ec63f Update netns to include support for PowerPC LE (ppc64le) architecture
Current version of netns used in libnetwork do not have requisite syscall
entry for PowerPC (ppc64le) arch. Consequently docker which uses libnetwork fails
to create any network enabled containers on Power systems.

This patch updates netns to latest commit 5478c060110032f972e86a1f844fdb9a2f008f2c
to add ppc64le syscall entry.

Signed-off-by: Pradipta Kr. Banerjee <bpradip@in.ibm.com>
2015-06-05 14:40:44 +05:30
aboch
3e160cb896 Merge pull request #256 from mavenugo/dup_endpoint
duplicate endpoint error handling
2015-06-04 16:35:52 -07:00
Madhu Venugopal
031e09d888 duplicate endpoint error handling
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 14:23:42 -07:00
Jana Radhakrishnan
fa480bd82a Merge pull request #211 from mavenugo/bn
WIP : default configs for new network in bridge driver
2015-06-04 11:58:14 -07:00
Madhu Venugopal
e67f9f4f79 Copy default configs from default Bridge to new bridge if not user configured
Also fixed a minor bug in client to choose bridge as the default driver.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 11:48:31 -07:00
Jana Radhakrishnan
ba14d8424c Merge pull request #255 from mavenugo/dhd
Moving hostdiscovery under build tag
2015-06-04 11:33:43 -07:00
Madhu Venugopal
cad0f33910 Merge pull request #239 from aboch/pmc
One port mapper per bridge network
2015-06-04 05:24:00 -07:00
Madhu Venugopal
5fff515028 Including hostdiscovery conditionaly under a build tag
In order to vendor-in libnetwork to docker, we need to remove the swarm
dependency even though it is used as library. using this PR, a new build
flag libnetwork_discovery is introduced in order to avoid pulling in the
unused hostdiscovery functionality into docker.
We are working with the Swarm project to see if we can modularize the
discovery package to become independent so that we can include them as a
vendor-in package in docker.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 05:00:09 -07:00
Madhu Venugopal
9d1cc7d56a Fixing a few go-vet issues
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-04 04:32:10 -07:00
Jana Radhakrishnan
9b3f203a7b Merge pull request #253 from aboch/ex
Change in bridge EndpointOperInfo()
2015-06-03 20:59:04 -07:00
Alessandro Boch
3be66461ba Change in bridge EndpointOperInfo()
- To also return the configured exposed ports, besides the
  port bindings; as now libnetwork/endpoint.go endpoint setters
  separate the exposed ports and port binding configs.
  Docker daemon will take care of aggregating the two sources
  for presentation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-03 20:28:15 -07:00
Madhu Venugopal
976c5bf0fa Merge pull request #212 from mrjana/cnm_integ
Add endpoint priority during join and cleanup libnetwork test code
2015-06-03 17:59:10 -07:00
Jana Radhakrishnan
a93d08aef5 Add container join priority option to endpoint
When an endpoint is joined by a container it may
optionally pass a priority to resolve resource
conflicts inside the sandbox when more than one
endpoint provides the same kind of resource. If the
the priority is the same for two endpoints with
conflicting resources then the endpoint network names
are used to resolve the conflict.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:58 -07:00
Jana Radhakrishnan
36303270c6 Introduce UnsetGateway(IPv6) methods
Sandbox needs unset gateway methods to cleanup
gateway settings to enable smooth transition
of the sandbox between endpoints.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:53 -07:00
Jana Radhakrishnan
c3d02744c6 Cleanup libnetwork test code
- The libnetwork test code had some issues in not properly
  passing the network options. Fixed it.
- Made controller a global value so that every test uses the
  same controller instance.
- Cleaned up endpoint and network objects after every test.
- Extended the endpoint join test case to test the same container
  join two different networks using two different endpoints.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:48:38 -07:00
Jana Radhakrishnan
ea8580d1e2 Remove only the endpoint owned interfaces
Only remove the interfaces owned by the endpoint from
the sandbox when the container leaves the endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-06-03 17:14:44 -07:00
aboch
0d2632e0e2 Merge pull request #240 from Metaswitch/remote-driver-static-routes
Add static routes to the remote driver.
2015-06-03 16:51:56 -07:00
Tom Denham
5c153bd018 Add static routes to the remote driver.
Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-06-03 16:31:21 -07:00
Jana Radhakrishnan
944a1cd026 Merge pull request #238 from WeiZhang555/clean
cleanup: remove unused variable
2015-06-03 14:45:59 -07:00
aboch
eeb156c778 Merge pull request #241 from Metaswitch/remote-driver-dstprefix
Update remote driver to use destination prefix.
2015-06-03 14:40:36 -07:00
aboch
5906671db5 Merge pull request #232 from Metaswitch/link-routes
Change scope to LINK when setting device routes
2015-06-03 14:27:44 -07:00
Tom Denham
5ad02e8c48 Change scope to LINK when setting device routes
Without this they don't have the desired effect.
The default when creating these types of routes with ip route add is link - the old setting of universe was just wrong.

Signed-off-by: Tom Denham <tom.denham@metaswitch.com>
2015-06-03 13:34:00 -07:00
aboch
927b19fa4b Merge pull request #237 from kunalkushwaha/json-tagged-struct
API struct tagged to produce proper output when marshalled #217
2015-06-02 16:44:27 -07:00