Commit Graph

109 Commits

Author SHA1 Message Date
Derek McGowan 43f00b74d7 Update logrus to v1.0.1
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-08-07 11:20:47 -07:00
Flavio Crisciani 9e54b8a8c7
Revert "use builtin package context rather than vendored one"
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-28 11:23:40 -07:00
allencloud 701497149a use builtin package context rather than vendored one
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-07-13 14:03:42 +08:00
Flavio Crisciani 90f43a798b
Revert "Move Cluster provider back to Moby"
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-25 10:47:02 -07:00
Flavio Crisciani 9cc5cd9b53
Moved the cluster provider to Moby
Moved the cluster provider interface definition from
libnetwork to moby

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-24 11:28:23 -07:00
Flavio Crisciani 5008b0c26d
Fix for swarm/libnetwork init race condition
This change cleans up the SetClusterProvider method.
Swarm calls the SetClusterProvider to pass to libnetwork the pointer
of the provider from which libnetwork can fetch all the information to
initialize the internal agent.

The method can be and is called multiple times passing the same value,
with the previous logic that was erroneusly spawning multiple go routines that
were making possiblea race between an agentInit and an agentClose.

The new logic aims to disallow it by checking for the provider passed and
ensuring that if the provider is already present there is nothing to do because
there is already an active go routine that is ready to process cluster events.
Moreover a patch on moby side takes care of clearing up the Cluster Events
dispacthing using only 1 channel to handle all the events types.
This will also guarantee in order event handling because now all the events are
piped into one single channel.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-05-04 15:35:28 -07:00
Flavio Crisciani c517188a56
Change GetRemoteAddr to return all managers
Change in the provider interface to let the provider
return the whole list of managers.
This will allow the netwrok db to have multiple choice
to establish the first adjacencies

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-04-27 16:58:42 -07:00
Flavio Crisciani 0c175ff67c
Add the data-path-addr
During configuration in SWARM mode is now possible to pass an additional
parameter --data-path-addr <ip|interface>.
The information is going to be used to configure which is the interface
that is going to be used for the data path for global scope drivers.
Up to now the only driver really using this extra parameter is the
overlay driver.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-04-14 16:52:40 -07:00
Hui Kang 35de7d0637 Fix misspelling fmt verb in dnet
Signed-off-by: Hui Kang <kangh@us.ibm.com>
2017-03-12 20:47:46 -04:00
Akihiro Suda 252567a063 proxy: clean up code (addendum to #1598)
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-01-12 04:46:23 +00:00
Santhosh Manohar f9fa6e0dc5 Merge pull request #1598 from AkihiroSuda/tcp-halfclose-docker-27539
proxy: fix an issue about half-closing net.TCPConn after io.Copy()
2017-01-05 20:36:57 -08:00
Alessandro Boch 75756e4712 Merge pull request #1568 from likel/refactor
Remove unnecessary string formats
2016-12-29 12:18:06 -08:00
Akihiro Suda d94f688dec proxy: fix an issue about half-closing net.TCPConn after io.Copy()
Fix docker/docker#27539

After io.Copy(to, from), we should call to.CloseWrite(), not to.CloseRead().

Without this fix, TestTCP4ProxyHalfClose (newly added in this commit) fails as
follows:

  --- FAIL: TestTCP4ProxyHalfClose (0.00s)
          network_proxy_test.go:135: EOF

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2016-12-24 20:49:04 +00:00
Ke Li 3830f32f8b fix review comments
Signed-off-by: Ke Li <kel@splunk.com>
2016-12-03 13:24:48 +08:00
Alessandro Boch 947eb35392 Control IPv6 on container's interface
- Disable ipv6 on all interface by default at sandbox creation.
  Enable IPv6 per interface basis if the interface has an IPv6
  address. In case sandbox has an IPv6 interface, also enable
  IPv6 on loopback interface.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-22 15:38:24 -08:00
Ke Li a3aa25c794 Remove unnecessary string formats
Signed-off-by: Ke Li <kel@splunk.com>
2016-11-22 09:29:53 +08:00
Alessandro Boch 7fd270684d Fix new golint reported errors
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-11-14 16:41:54 -08:00
Yong Tang e02f9e9a49 Fix issue for `--fixed-cidr` when bridge has multiple addresses
This fix tries to address the issue raised in:
https://github.com/docker/docker/issues/26341
where multiple addresses in a bridge may cause `--fixed-cidr` to
not have the correct addresses.

The issue is that `netutils.ElectInterfaceAddresses(bridgeName)`
only returns the first IPv4 address.

This fix changes `ElectInterfaceAddresses()` and `addresses()`
so that all IPv4 addresses are returned. This will allow the
possibility of selectively choose the address needed.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
2016-10-21 13:58:16 -07:00
Justin Cormack 0a8b77fb86 Do not use logrus for proxy
This simplifies how we build it in docker/docker as no vendoring needed,
and this does program not use any logrus features.

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-10-19 00:01:11 +01:00
Anusha Ragunathan a9a4aaf382 Update plugingetter import path.
Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-10-07 12:00:57 -07:00
Anusha Ragunathan 7b26d7e300 Make libnetwork understand pluginv2.
As part of daemon init, network and ipam drivers are passed a
pluginstore object that implements the plugin/getter interface. Use this
interface methods in libnetwork to interact with network plugins. This
interface provides the new and improved pluginv2 functionality and falls
back to pluginv1 (legacy) if necessary.

Signed-off-by: Anusha Ragunathan <anusha@docker.com>
2016-09-27 15:29:10 -07:00
Jana Radhakrishnan 8b04ffb31a Honor user provided listen address for gossip
If user provided a non-zero listen address, honor that and bind only to
that address. Right now it is not honored and we always bind to all ip
addresses in the host.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-22 11:41:57 -07:00
Jana Radhakrishnan 734d626141 Move engine-api to docker/docker/api
Remove all dependencies to engine-api and start using docker/docker/api.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 14:38:45 -07:00
Jana Radhakrishnan a5f8723c30 Adjust WaitForDetachment to also accept networkID
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-31 12:30:18 -07:00
Jana Radhakrishnan d98be36f7a Add network attachment methods to cluster provider
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-22 18:41:38 -07:00
Jana Radhakrishnan b33b7c68a5 Merge pull request #1205 from allencloud/fix-typos
use grep to find a/an misuse
2016-08-01 09:49:31 -07:00
Madhu Venugopal f6d896889d Adding Advertise-addr support
With this change, all the auto-detection of the addresses are removed
from libnetwork and the caller takes the responsibilty to have a proper
advertise-addr in various scenarios (including externally facing public
advertise-addr with an internal facing private listen-addr)

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-21 02:44:25 -07:00
Justin Cormack 320a93c618 Make the docker proxy a standalone binary not a re-exec
Rather than re-execing docker as the proxy, create a new command docker-proxy
that is much smaller to save memory in the case where there are a lot of
procies being created. Also allows the proxy to be replaced, for example
in Docker for Mac we have a proxy that proxies to osx instead of locally.

This is the vendoring pull for https://github.com/docker/docker/pull/23312

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
2016-07-04 13:17:16 +01:00
Santhosh Manohar 9a0ad6492f Add support for encrypting gossip traffic
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-06-04 03:55:14 -07:00
Madhu Venugopal 600ba1ed0a Provide a way for libnetwork to make use of Agent mode functionalities
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-06-05 18:41:21 -07:00
allencloud 8acef98c5f use grep to find a/an misuse
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-06-03 16:35:33 +08:00
Jana Radhakrishnan 42a48a2d36 Dnet agent mode support and IT
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-05-05 13:59:00 -07:00
Alessandro Boch c378054576 Fix cross compilation issues
- Fix circle-ci-cross target
- Remove unsupported os/arch targets
- Fix dnet build for windows/amd64
- Fix a solaris build breakage

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-04-21 11:20:01 -07:00
Jana Radhakrishnan ed939ef5c3 Add driver api enhancements for gossip
With the introduction of a driver generic gossip in libnetwork it is not
necessary for drivers to run their own gossip protocol (like what
overlay driver is doing currently) but instead rely on the gossip
instance run centrally in libnetwork. In order to achieve this, certain
enhancements to driver api are needed. This api aims to provide these
enhancements.

The new api provides a way for drivers to register interest on table
names of their choice by returning a list of table names of interest as
a response to CreateNetwork. By doing that they will get notified if a
CRUD operation happened on the tables of their interest, via the newly
added EventNotify call.

Drivers themselves can add entries to any table during a Join call by
invoking AddTableEntry method any number of times during the Join
call. These entries lifetime is the same as the endpoint itself. As soon
as the container leaves the endpoint, those entries added by driver
during that endpoint's Join call will be automatically removed by
libnetwork. This action may trigger notification of such deletion to all
driver instances in the cluster who have registered interest in that
table's notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-18 19:55:39 -07:00
Alessandro Boch 64d6c60d42 Merge pull request #1118 from mrjana/api
Add support to accepting arbitrary network ID
2016-04-15 12:52:16 -07:00
Jana Radhakrishnan f76409b411 Add support to accepting arbitrary network ID
Currently the libnetwork function `NewNetwork` does not allow
caller to pass a network ID and it is always generated internally.
This is sufficient for engine use. But it doesn't satisfy the needs
of libnetwork being used as an independent library in programs other
than the engine. This enhancement is one of the many needed to
facilitate a generic libnetwork.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-15 12:34:21 -07:00
Jana Radhakrishnan 5ca79d6b87 Remove all netlink/osl deps from ipam/ipamutils
Currently ipam/ipamutils has a bunch of dependencies
in osl and netlink which makes the ipam/ipamutils harder
to use independently with other applications. This PR
modularizes ipam/ipamutils into a standalone package
with no OS level dependencies.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-10 11:05:39 -07:00
Jana Radhakrishnan 479274178d Update Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-04-08 12:58:08 -07:00
Vincent Demeester 18fbf39c59 Use gofmt with -s instead of goimports
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2016-02-12 14:07:00 +01:00
Ryan Belgrave 12922fce2e IpamOptions per network not per ipam subnet
Signed-off-by: Ryan Belgrave <rmb1993@gmail.com>
2016-01-07 21:28:54 -05:00
Jana Radhakrishnan fcda7d3b40 Merge pull request #839 from rosenhouse/fixup-readme
Fix up example code
2015-12-23 15:31:36 -08:00
Jana Radhakrishnan 9227b00fea Fix up Godeps and update docker/docker packages
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-12-23 15:07:33 -08:00
David Bellotti 1c3322febb Fix up example code
- runs to completion without error
- demonstrates info available when using bridge network driver

Closes #837

Signed-off-by: Gabe Rosenhouse <grosenhouse@pivotal.io>
2015-12-23 11:47:14 -08:00
Chun Chen b1e94ca09a Add DisableGatewayService in JoinInfo to offering drivers the ability to disable default gateway
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-12-03 12:51:28 +08:00
Jana Radhakrishnan 358355e78a Add IT case for external connectivity
Added IT cases for external connectivity check for bridge
and overlay networks, both initially and after a restart.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-28 19:10:38 -07:00
Alessandro Boch d53a6f9815 Enable network labels in Rest API
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-09 01:06:20 -07:00
Jana Radhakrishnan 81f8ce8536 Add default network restart test case
Added restart test for default network so that we can test
bridge network persistence. Also added changes to dnet to
delete the default network if it is present.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-08 21:31:19 -07:00
Alessandro Boch a49fb6b897 Phase-2 bridge driver changes to support IPAM
- Set bridge ipv4 address when bridge is present
- IPv6 changes for bridge
- Convert unit tests to the new model

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-10-08 16:22:03 -07:00
Jana Radhakrishnan a6ba4ce2d6 Pass down store configs to driver
- Renamed netlabel prefixes to accomodate both global
       and local store configs.
     - Added a `private` marker.
     - Skipping the data store configs for remote driver
       so that external plugins don't get it as there is
       no secure and sane way to coordinate providing
       data store access to external plugins.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 17:28:47 -07:00
Jana Radhakrishnan 25f496f771 Remove always-on watch for networks and endpoints
Always on watching of networks and endpoints can
affect scalability of the cluster beyond a few nodes.
Remove pro active watching and watch only the objects
you are interested in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:49 -07:00