Commit Graph

278 Commits

Author SHA1 Message Date
Madhu Venugopal
e2bdf92d6b Merge pull request #187 from mrjana/cross
Move network types to types package
2015-05-20 14:03:52 -07:00
Jana Radhakrishnan
7783fcd13f Move network types to types package
This is need to decouple types from netutils which has linux
dependencies. This way the client code which needs network types
can just pull in types package which makes client code platform
agnostic.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-20 20:28:46 +00:00
Madhu Venugopal
b39597744b Merge pull request #182 from mrjana/cnm_integ
Fix /etc/resolv.conf permission issue
2015-05-19 22:57:58 -07:00
Jana Radhakrishnan
a5ed1b5bd4 Fix /etc/resolv.conf permission issue
The container's /etc/resolv.conf permission was getting setup
as 0600 while it should be 0644 for every user inside the
container to be able to read it. The tempfile that we create
initially to populate the resolvconf content is getting created
with 0600 mode. Changed it to 0644 once it is created since there
is noway to pass mode option to ioutil.Tempfile

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-20 05:46:30 +00:00
Jana Radhakrishnan
a02aac8e0b Merge pull request #178 from mavenugo/master
Porting https://github.com/docker/docker/pull/12437
v0.2
2015-05-19 15:35:30 -07:00
Madhu Venugopal
7308fd4489 Porting https://github.com/docker/docker/pull/12437
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 15:28:48 -07:00
Madhu Venugopal
47f8b25ffb Merge pull request #177 from mrjana/cnm_integ
Cleanup namespace files
2015-05-19 15:24:32 -07:00
Jana Radhakrishnan
f88f4f01c4 Cleanup namespace files
It may happen that the application (docker) may exit ungracefully
exit without calling leaves on endpoint and may result in stale
namespace files. So if a sandbox is created with the same key
attempt to cleanup the file if it exists before creating the
sandbox.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 22:11:09 +00:00
Jana Radhakrishnan
fb2c0dfbad Merge pull request #168 from mavenugo/dnet-integ
Client / API integration & dnet tool
2015-05-19 14:32:07 -07:00
Madhu Venugopal
fa78a98fc6 Initial dnet tool to test and manage libnetwork end-to-end
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:30 -07:00
Madhu Venugopal
2b57d3f0ee Godep update to pull in parsers and term packages
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:30 -07:00
Madhu Venugopal
8644d00d3c Client to make use of REST API
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:30 -07:00
Madhu Venugopal
4ba1540409 Fixed some basic client UI issues for the "network" command
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-19 14:10:22 -07:00
Madhu Venugopal
6678d7202d Merge pull request #176 from aboch/ci
Fix Makefile
2015-05-19 11:19:03 -07:00
Alessandro Boch
15cbcc55eb Fix Makefile
- To report the godep test err code to CircleCI

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-19 11:06:56 -07:00
Madhu Venugopal
a11cac719f Merge pull request #175 from mrjana/cnm_integ
Fix panic on leave of host driver endpont leave
2015-05-19 10:28:58 -07:00
Jana Radhakrishnan
d33168d764 Fix panic on leave of host driver endpont leave
There is a panic when two containers joining a host
network leave one after another. The problem was that
in controller.go the sandboxData was not stored as a
pointer reference. So when we got the data from the map
it was the copy of the data and refcnt increment was done
on that. Changed it to hold a reference.  Also added a test
case to test it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-19 17:14:00 +00:00
Jana Radhakrishnan
bef625fe8a Merge pull request #173 from aboch/ux
Restore anonymus import in iptables_test.go
2015-05-19 09:12:36 -07:00
Alessandro Boch
376f1a5617 Restore anonymus import in iptables_test.go
- Which is needed when running make (test in container)

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-18 21:56:36 -07:00
Madhu Venugopal
e7a16734a2 Merge pull request #171 from aboch/ux
Optional Userland Proxy
2015-05-18 20:02:58 -07:00
Alessandro Boch
56369550a7 Optional Userland Proxy
- Port https://github.com/docker/docker/pull/12165 to libnetwork
- More tests will be added later

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-18 18:13:39 -07:00
Madhu Venugopal
06d7388e8e Merge pull request #170 from mrjana/cnm_integ
Change default namespace path
2015-05-18 16:35:33 -07:00
Jana Radhakrishnan
71361ee07d Change default namespace path
Change namespace path to be /var/run/docker/netns since
/var/run/netns is being used by iproute2 and it is mounted
as MS_SHARED which causes some complications during integration.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-18 23:05:10 +00:00
Madhu Venugopal
95ab32fb72 Merge pull request #152 from mrjana/cnm
Driver api refactor
2015-05-18 16:04:13 -07:00
Jana Radhakrishnan
d8ba1e2310 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
Jana Radhakrishnan
7242f8fe08 Merge pull request #159 from mavenugo/net-plugin
Libnetwork Integration with Plugin and Remote Driver Backend
2015-05-18 13:54:33 -07:00
Madhu Venugopal
c756c47613 Remote Driver integration with Plugin Framework
This commit brings in Remote driver integrated with the newly introduced
Plugin framework as a Docker Package.

The Plugin framework is designed as a Package and has no runtime
dependancy on Docker platform. It stands on its own and is a good
candidate for getting the remote drivers hooked to libnetwork

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-18 13:42:19 -07:00
Madhu Venugopal
88cb8027ab Upgrading Godep to the Latest Docker Pacakages that brings in the Plugins infra
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-18 13:41:32 -07:00
Madhu Venugopal
34fcbeb31e Merge pull request #165 from junxu/fix-api
Fix misuse urlNwName and urlNwID in api.
2015-05-17 21:38:52 -07:00
junxu
763c2ace65 Fix misuse urlNwName and urlNwID in api.
Signed-off-by: junxu <xujun@cmss.chinamobile.com>
2015-05-18 02:49:10 +00:00
Madhu Venugopal
99af9a6e45 Merge pull request #164 from aboch/pg
Remove pkg directory
2015-05-17 08:29:58 -07:00
Jana Radhakrishnan
71bf530cda Merge pull request #160 from mavenugo/ipv6test
Ignore the OldHash if the resolvConfPath is invalid
2015-05-16 17:03:29 -07:00
Alessandro Boch
ee72ee177d Remove pkg directory
- As recommended by Docker committers.
- Will introduce internal directory when go supports it

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-05-16 16:12:13 -07:00
Madhu Venugopal
63a5c47585 Ignore the OldHash if the resolvConfPath is invalid
If resolvConfPath is unavailable and if the internally generated .hash file
is still present, then updateDNS should not consider the presence of internally
generated .hash. Rather, it must handle it as a case of using this
resolvConfPath for the first time.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-16 05:35:04 -07:00
Madhu Venugopal
57e3bc4718 Merge pull request #158 from aboch/idt
Network and Endpoint query methods to return error on not found
2015-05-15 16:26:17 -07:00
Alessandro Boch
5e044b5b5f 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
Madhu Venugopal
1e84379b1e Merge pull request #157 from mrjana/cnm_integ
Fix DNS entry update issue
2015-05-15 14:58:12 -07:00
Jana Radhakrishnan
1eca8d4088 Fix DNS entry update issue
When an update is done to the container resolv.conf file
and it was inheriting host entries, then we should not
re-read the host entries when the container leaves and
re-joins the endpoint.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-15 21:01:53 +00:00
Madhu Venugopal
78c81a0fa6 Merge pull request #154 from mrjana/cnm_integ
Change portallocator New() method to Get()
2015-05-14 15:25:30 -07:00
Jana Radhakrishnan
6a0f240c18 Changed portallocator New() method to Get()
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-14 21:59:17 +00:00
Jana Radhakrishnan
29250c28c1 Merge pull request #146 from aboch/jpi
Initial libnetwork rest api
2015-05-14 13:03:47 -07:00
Alessandro Boch
6602342a7f 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
Madhu Venugopal
655d7149af Merge pull request #149 from mrjana/cnm_integ
Update resolvconf and iptables packages
2015-05-12 20:37:54 -07:00
Jana Radhakrishnan
652f3d6182 Update resolvconf and iptables packages from docker
Updated resolvconf and iptables packages based on upstream
changes which we need for libnetwork rebase. There were
docker engine changes based on this so we need this to
be integrated now.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-13 03:29:17 +00:00
Madhu Venugopal
c562f5e262 Merge pull request #148 from mrjana/tcfail
Fixed test case intermittent failure problem and an ipv6 issue
2015-05-12 17:57:32 -07:00
Jana Radhakrishnan
a971716f29 Fixed an intermittent issue in the libnetwork test
The libnetwork test does not need to run inside a namespace
when inside a container. This results in unpredictable behavior
when the sandbox code unlocks the go routine from the OS thread
while the test code still wants it locked in the OS thread. This
will result in unreachable interfaces when the go routine
migrates to a different OS thread.

Fixed by passing a special test flag which is only set to true
when the test is run inside a container.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-13 00:22:00 +00:00
Jana Radhakrishnan
3c1dd60ebb Fix issue in ipv6 when a non-default link-local ipv6 address is present.
If the bridge exists and it exists with a different link local ip address
than fe80::1/64 then we waifl to accept that as a valid configuration without
trying to add the default link local ip address. With this fix we always try
to add the default link local address if it doesn't exist.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-12 23:43:06 +00:00
Madhu Venugopal
0f3d06a0fd Merge pull request #130 from junxu/master
Simplify the code in the RegisterSubnet method of ipallocator.
2015-05-12 11:42:09 -07:00
Jana Radhakrishnan
6a6a45a58d Merge pull request #143 from squaremo/driver_init_not_new
Make driver packages register themselves via DriverCallback
2015-05-11 22:14:51 -07:00
junxu
24d744dbf7 Simplify the code in the RegisterSubnet method of ipallocator. 2015-05-12 00:44:34 +00:00