Commit graph

2709 commits

Author SHA1 Message Date
Christopher Adam Telfer
02bee778e8 Merge pull request #2264 from halfcrazy/fix/typo
Fix typos in comments
2018-09-07 11:14:20 -04:00
Yan Zhu
ce46100a27 doc: fix typo
Signed-off-by: Yan Zhu <yanzhu@alauda.io>
2018-09-07 11:48:15 +08:00
Christopher Adam Telfer
e29452841e Merge pull request #2259 from resin-os/handle-invalid-default-gateways
bridge: fix error handling for stale default gateways
2018-08-30 11:14:22 -04:00
Christopher Adam Telfer
10008597e0 Merge pull request #2077 from quadespresso/master
Added support for Swarm Service Driller (ssd)
2018-08-28 13:35:24 -04:00
Petros Angelatos
72eed906b8 bridge: fix error handling for stale default gateways
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2018-08-24 17:43:12 -07:00
Christopher Adam Telfer
556f9f1348 Merge pull request #2258 from Lion-Wei/master
Support getting active/inactive IPVS connection counts
2018-08-24 10:21:53 -04:00
liangwei
99c4c6d5fc ipvs support rs connection information
Signed-off-by: liangwei <liangwei14@huawei.com>
2018-08-22 21:14:26 +08:00
Chris Telfer
afcf6c526d Merge pull request #2253 from selansen/global_add_pool
Add getter functions for Default Address Pools
2018-08-16 16:31:12 -04:00
selansen
814f6c1f4b Add getter function for Default Address Pools
ipamutils has two default address pool. Instead of allowing them to
be accessed directly, adding get functions so that other packages
can use get APIs.

Signed-off-by: selansen <elango.siva@docker.com>
2018-08-16 15:48:42 -04:00
Jim Carroll
a478edc819 Added support for Swarm Service Driller (ssd)
Signed-off-by: Jim Carroll <jim.carroll@docker.com>
2018-08-16 14:30:23 -05:00
Madhu Venugopal
bc2180c4b1 Merge pull request #2251 from dani-docker/ssd_image_rename
Move SSD image to docker
2018-08-16 11:20:51 -07:00
Chris Telfer
26a1cb791d Merge pull request #2241 from selansen/global_add_pool
Global Default Address Pool support
2018-08-16 12:03:01 -04:00
selansen
52e85b4b9a Global Default Address Pool support
This change brings global default address pool feature into
libnetwork. Idea is to reuse same code flow and functions that were
implemented for local scope default address pool.
Function InitNetworks carries most of the changes. local scope default
address pool init should always happen only once. But Global scope
default address pool can be initialized multiple times.

Signed-off-by: selansen <elango.siva@docker.com>
2018-08-16 11:28:24 -04:00
Dani Louca
17966c940a Move SSD image to docker
Signed-off-by: Dani Louca <dani.louca@docker.com>
2018-08-14 14:41:33 -04:00
Flavio Crisciani
3321709a62 Merge pull request #2242 from euanh/pin-gogoprotobuf
Dockerfile: Install a fixed version of gogoprotobuf
2018-07-26 10:51:42 -07:00
Flavio Crisciani
92dd7fda05 Merge pull request #2240 from ctelfer/nice-lb-names
Give LB sandboxes predictable names
2018-07-25 10:14:10 -07:00
Chris Telfer
6d27900ffe Merge pull request #2232 from fcrisciani/ubuntu-dns
Proper handling sandbox options
2018-07-25 13:13:05 -04:00
Euan Harris
72905ebb13 Dockerfile: Install a fixed version of gogoprotobuf
This avoids build failures when gogoprotobuf is changed upstream.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-25 15:42:25 +01:00
Chris Telfer
5041b74451 Give LB sandboxes predictable names
Change the sandbox IDs for the sandboxes of load-balancing endpoints to
be "lb_XXXXXXXXX" where XXXXXXXXX is the network ID that this sandbox
load balances for.  This makes it easier to find these sandboxes in
/var/run/docker/netns and thus makes debugging easier.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-24 17:10:41 -04:00
Flavio Crisciani
55ad3ef1a4 Fix handling of the resolv.conf
Leverage what is it passed from the daemon
Fix check about the host networking

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-24 10:18:10 -07:00
Flavio Crisciani
204ce3e31d Create internal directory
Internal directory is designed to contain libraries
that are exclusively used by this project

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-16 17:34:20 -07:00
Flavio Crisciani
92b8dfd36c Merge pull request #2234 from talex5/example-imports
Add required imports to example code in README.md
2018-07-16 13:33:41 -07:00
Thomas Leonard
e88eed1d65 Add required imports to example code in README.md
Signed-off-by: Thomas Leonard <thomas.leonard@docker.com>
2018-07-16 14:50:53 +01:00
Flavio Crisciani
8698ad1af1 Merge pull request #2229 from fcrisciani/spelling
Spelling
2018-07-12 13:11:28 -07:00
Flavio Crisciani
8b6cb7d59a Merge pull request #2102 from trapier/support-inspect-stopped-containers
support.sh: also inspect stopped containers
2018-07-12 13:05:13 -07:00
Flavio Crisciani
6defa7c807 Make protobuf check silent
Avoid printing the if condition

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-12 12:54:59 -07:00
Josh Soref
a06f1b2c4e Spelling fixes
* addresses
* assigned
* at least
* attachments
* auxiliary
* available
* cleanup
* communicate
* communications
* configuration
* connection
* connectivity
* destination
* encountered
* endpoint
* example
* existing
* expansion
* expected
* external
* forwarded
* gateway
* implementations
* implemented
* initialize
* internally
* loses
* message
* network
* occurred
* operational
* origin
* overlapping
* reaper
* redirector
* release
* representation
* resolver
* retrieve
* returns
* sanbdox
* sequence
* succesful
* synchronizing
* update
* validates

Signed-off-by: Josh Soref <jsoref@gmail.com>
2018-07-12 12:54:44 -07:00
Trapier Marshall
b9223019c2 support.sh: also inspect stopped containers
Signed-off-by: Trapier Marshall <trapier.marshall@docker.com>
2018-07-12 15:22:42 -04:00
Flavio Crisciani
9db90d27ed Merge pull request #2217 from euanh/protobuf-check
Check that generated protocol buffer code is up to date
2018-07-11 15:12:54 -07:00
Flavio Crisciani
0f593ae92b Merge pull request #2146 from ctelfer/fix-overlay-vxlan-races
Fix overlay vxlan races
2018-07-11 10:41:46 -07:00
Chris Telfer
4e6580c4c1 Refactor locking for join/leave to avoid race
Instead of using "sync.Once" to determine whether to initialize a
network sandbox or subnet sandbox, we use a traditional mutex +
initialization boolean.  This is because the initialization state isn't
truly a once-and-done condition.  Rather, libnetwork destroys network
and subnet sandboxes when the last endpoint leaves them.  The use of
sync.Once in this kind of scenario requires, therefore, re-initializing
the Once which is impoissible.  So the approach that libnetwork
currently takes is to use a pointer to a Once and redirect that pointer
to a new Once on reset.  This leads to nasty race conditions.

In addition to refactoring the locking, this patch merges the functions
joinSandbox(), and joinSubnetSandbox(). This makes the code both cleaner
and it also holds the network and subnet locks through the series of
read-modify-writes avoiding further potential races.  This does reduce
the potential parallelism which could be applied should there be many
joins coming in on many different subnets in the same overlay network.
However, this should be an extremely minor performance hit for a very
obscure case.

One important pattern in this commit is that it is crucial to avoid
sending peerDB messages while holding a driver or network lock.  The
changes herein defer such (asynchronous) notifications until after
release of such locks.  This prevents deadlocks where the peerDB
blocks acquiring said locks while the network method blocks trying
to send to the peerDB's channel.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-10 12:13:39 -04:00
Euan Harris
56c4a6dd3f Makefile: Add check for out of date protocol buffer code
'make check' will now fail if the files produced by re-running protoc
differ from those which are checked into the repository.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-10 17:01:48 +01:00
Euan Harris
2b602bf3d0 Makefile: Add protobuf-local target, runnable within build container
Outside the build container, run: make protobuf
Inside the build container, run: make protobuf-local

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-10 17:01:48 +01:00
Euan Harris
3bebfbc34e Makefile: Document and organize into sections
Add documentation and move protobuf target into Build section

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-10 17:01:48 +01:00
Euan Harris
348ed0a1a8 circleci: Rename 'lint' to 'check' to match build target
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-10 17:01:48 +01:00
Flavio Crisciani
e353363bab Merge pull request #2228 from euanh/use-init
Makefile: Run containers with --init for proper signal handling
2018-07-10 08:09:09 -07:00
Santhosh Manohar
5fdfa8c52c Cleanup interfaces properly when vxlan plumbling fails
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-10 10:33:46 -04:00
Euan Harris
c699a1215e Makefile: Run containers with --init for proper signal handling
This makes it possible to Ctrl-C tests and builds again.   Zombie
processes will also be reaped correctly.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-10 10:20:44 +01:00
Flavio Crisciani
38ec34e0e7 Merge pull request #2122 from quadespresso/esc-509
Changed loglevel from error to warning
2018-07-06 16:28:11 -07:00
Flavio Crisciani
968b269ec8 Merge pull request #2220 from vdemeester/to-gotest.tools
Migrate to gotest.tools :)
2018-07-06 16:15:13 -07:00
Jim Carroll
9da8e04c70 Updated handling of disable_ipv6 file
Signed-off-by: Jim Carroll <jim.carroll@docker.com>
2018-07-06 16:42:29 -05:00
Flavio Crisciani
e0c5c1b5d3 Merge pull request #2222 from fcrisciani/e2e-test
Create tag for master code
2018-07-06 13:36:29 -07:00
Vincent Demeester
06d471d186 Migrate to gotest.tools :)
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-06 11:01:37 -07:00
Vincent Demeester
6c0f597a82 Remove unused deps from vendor.conf
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2018-07-06 10:40:22 -07:00
Flavio Crisciani
ffe33f932e Create tag for master code
In order to support different branches
create master tag

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-06 10:15:00 -07:00
Flavio Crisciani
b0a0059237 Merge pull request #2216 from fcrisciani/netdb-qlen-issue
NetworkDB qlen optimization
2018-07-05 15:02:58 -07:00
Flavio Crisciani
85862008e9 Merge pull request #2221 from ctelfer/use-fmt-string-precision
Use fmt precision to limit string length
2018-07-05 14:52:49 -07:00
Chris Telfer
06922d2d81 Use fmt precision to limit string length
The previous code used string slices to limit the length of certain
fields like endpoint or sandbox IDs.  This assumes that these strings
are at least as long as the slice length.  Unfortunately, some sandbox
IDs can be smaller than 7 characters.   This fix addresses this issue
by systematically converting format string calls that were taking
fixed-slice arguments to use a precision specifier in the string format
itself.  From the golang fmt package documentation:

    For strings, byte slices and byte arrays, however, precision limits
    the length of the input to be formatted (not the size of the output),
    truncating if necessary. Normally it is measured in runes, but for
    these types when formatted with the %x or %X format it is measured
    in bytes.

This nicely fits the desired behavior: it will limit the number of
runes considered for string interpolation to the precision value.

Signed-off-by: Chris Telfer <ctelfer@docker.com>
2018-07-05 17:44:04 -04:00
Flavio Crisciani
00611a5255 Merge pull request #2215 from hzue/master
Fix error handling about bridgeSetup
2018-07-05 14:34:41 -07:00
Abhinandan Prativadi
8e9bb2a618 Merge pull request #2173 from euanh/ipam-check
Test overlapping pool allocation
2018-07-05 09:37:26 -07:00