1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

2696 commits

Author SHA1 Message Date
fanjiyun
03ba96c5cf Rolling back the port configs if failed to programIngress()
Signed-off-by: fanjiyun <fan.jiyun@zte.com.cn>
2018-09-11 19:10:59 +08:00
Flavio Crisciani
3321709a62 Merge pull request 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 from ctelfer/nice-lb-names
Give LB sandboxes predictable names
2018-07-25 10:14:10 -07:00
Chris Telfer
6d27900ffe Merge pull request 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 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 from fcrisciani/spelling
Spelling
2018-07-12 13:11:28 -07:00
Flavio Crisciani
8b6cb7d59a Merge pull request 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 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 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 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 from quadespresso/esc-509
Changed loglevel from error to warning
2018-07-06 16:28:11 -07:00
Flavio Crisciani
968b269ec8 Merge pull request 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 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 from fcrisciani/netdb-qlen-issue
NetworkDB qlen optimization
2018-07-05 15:02:58 -07:00
Flavio Crisciani
85862008e9 Merge pull request 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 from hzue/master
Fix error handling about bridgeSetup
2018-07-05 14:34:41 -07:00
Abhinandan Prativadi
8e9bb2a618 Merge pull request from euanh/ipam-check
Test overlapping pool allocation
2018-07-05 09:37:26 -07:00
hzue
5ef4c59574 Fix error handling about bridgeSetup
Fix the error from bridgeSetup doesn't handle by the defer function in the createNetwork function.

Signed-off-by: Terry Chu <jubosh.tw@gmail.com>
2018-07-05 16:46:56 +08:00
Euan Harris
1383aadf59 ipam: Test rejection of overlapping pool requests
TestOverlappingRequests checks that pool requests which are supersets or
subsets of existing allocations, and those which overlap with existing
allocations at the beginning or the end.

Multiple allocation is now tested by TestOverlappingRequests, so
TestDoublePoolRelease only needs to test double releasing.

Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-04 09:50:53 +01:00
Euan Harris
6fd25eea33 ipam, types: Expand documentation
Signed-off-by: Euan Harris <euan.harris@docker.com>
2018-07-04 09:50:31 +01:00
Flavio Crisciani
a3d24cf4b4 Merge pull request from fcrisciani/base-image
CircleCI use latest image
2018-07-03 17:45:12 -07:00
Flavio Crisciani
4cbba0da48 CircleCI use latest image
Avoid confusion with the golang versioning

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-03 14:40:57 -07:00
Flavio Crisciani
3788e7949d Merge pull request from fcrisciani/ipvs-sysctl
Add knobs on LB sandbox
2018-07-03 14:15:46 -07:00
Flavio Crisciani
f857b5b8f8 Merge pull request from idealhack/tests-benchmark
test: update tests to use sub-benchmarks
2018-07-03 14:06:58 -07:00
Flavio Crisciani
5f670981d9 Merge pull request from thaJeztah/update_testify
Update stretchr/testify to v1.2.2
2018-07-03 13:25:10 -07:00
Flavio Crisciani
55e4cc7262 Optimize networkDB queue
Added some optimizations to reduce the messages in the queue:
1) on join network the node execute a tcp sync with all the nodes that
it is aware part of the specific network. During this time before the
node was redistributing all the entries. This meant that if the network
had 10K entries the queue of the joining node will jump to 10K. The fix
adds a flag on the network that would avoid to insert any entry in the
queue till the sync happens. Note that right now the flag is set in
a best effort way, there is no real check if at least one of the nodes
succeed.
2) limit the number of messages to redistribute coming from a TCP sync.
Introduced a threshold that limit the number of messages that are
propagated, this will disable this optimization in case of heavy load.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-02 16:59:45 -07:00
Flavio Crisciani
b09cb39fa5 Enhance testing infra
Allow to write and delete X number of entries
Allow to query the queue length

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2018-07-02 16:47:34 -07:00
Flavio Crisciani
abc4c5c5d8 Merge pull request from thaJeztah/fix_duplicate_ndots
Fix duplicate ndots:0, and improve validation
2018-06-29 10:28:22 -07:00
Sebastiaan van Stijn
9295e124bb Update stretchr/testify to v1.2.2
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-29 01:48:39 +02:00
Sebastiaan van Stijn
341845b5f2 ndots: produce error on negative numbers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-06-29 01:22:17 +02:00