Commit graph

279 commits

Author SHA1 Message Date
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
ad78050657 Merge pull request #187 from mrjana/cross
Move network types to types package
2015-05-20 14:03:52 -07:00
Jana Radhakrishnan
a9fa764cbb 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
36294e8253 Merge pull request #182 from mrjana/cnm_integ
Fix /etc/resolv.conf permission issue
2015-05-19 22:57:58 -07:00
Jana Radhakrishnan
407e41d394 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
9a4894193f Merge pull request #178 from mavenugo/master
Porting https://github.com/docker/docker/pull/12437
2015-05-19 15:35:30 -07:00
Madhu Venugopal
56375f3687 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
f38ad0c939 Merge pull request #177 from mrjana/cnm_integ
Cleanup namespace files
2015-05-19 15:24:32 -07:00
Jana Radhakrishnan
8c5750558a 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
fcc53363cf Merge pull request #168 from mavenugo/dnet-integ
Client / API integration & dnet tool
2015-05-19 14:32:07 -07:00
Madhu Venugopal
36a0f91b5d 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
57628535ba 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
977fcdd952 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
2d3758619b 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
ba2098c05c Merge pull request #176 from aboch/ci
Fix Makefile
2015-05-19 11:19:03 -07:00
Alessandro Boch
a794fa07b7 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
c0cce36677 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
9d4b69df73 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
c70e94b6bf Merge pull request #173 from aboch/ux
Restore anonymus import in iptables_test.go
2015-05-19 09:12:36 -07:00
Alessandro Boch
1589c43f9d 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
ccc62387fb Merge pull request #171 from aboch/ux
Optional Userland Proxy
2015-05-18 20:02:58 -07:00
Alessandro Boch
902e8746d3 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
32b1657a28 Merge pull request #170 from mrjana/cnm_integ
Change default namespace path
2015-05-18 16:35:33 -07:00
Jana Radhakrishnan
030817808c 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
4b385bdbb4 Merge pull request #152 from mrjana/cnm
Driver api refactor
2015-05-18 16:04:13 -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
Jana Radhakrishnan
6429fcc954 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
80ca3c2330 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
cb8bbd3ded 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
541e96db49 Merge pull request #165 from junxu/fix-api
Fix misuse urlNwName and urlNwID in api.
2015-05-17 21:38:52 -07: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
Madhu Venugopal
80ad544b26 Merge pull request #164 from aboch/pg
Remove pkg directory
2015-05-17 08:29:58 -07:00
Jana Radhakrishnan
1c21e59b97 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
f16db2c3ad 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
e2fea0f945 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
8d4460a208 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
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
Madhu Venugopal
a6023f3462 Merge pull request #157 from mrjana/cnm_integ
Fix DNS entry update issue
2015-05-15 14:58:12 -07:00
Jana Radhakrishnan
d96e94897e 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
7623cd3f4d Merge pull request #154 from mrjana/cnm_integ
Change portallocator New() method to Get()
2015-05-14 15:25:30 -07:00
Jana Radhakrishnan
4a3c7e1bb5 Changed portallocator New() method to Get()
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-05-14 21:59:17 +00:00
Jana Radhakrishnan
a76c5e1490 Merge pull request #146 from aboch/jpi
Initial libnetwork rest api
2015-05-14 13:03:47 -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
Madhu Venugopal
ab9dfa2b1e Merge pull request #149 from mrjana/cnm_integ
Update resolvconf and iptables packages
2015-05-12 20:37:54 -07:00
Jana Radhakrishnan
26a5a79374 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
03f29ff11b 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
10fafb06eb 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
79556b1ccc 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
b9fc99be2c 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
d1ce8f01a4 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