Commit graph

1601 commits

Author SHA1 Message Date
Madhu Venugopal
7feaa49556 Merge pull request #1457 from aboch/pnc
Lock agent access in addDriverWatches
2016-09-20 17:49:47 -07:00
Madhu Venugopal
9fae5d1779 Merge pull request #1412 from msabansal/dnsv2
DNS support for Windows
2016-09-20 17:35:26 -07:00
Alessandro Boch
8653b72786 Lock agent access in addDriverWatches
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-20 14:18:49 -07:00
msabansal
ce65a4cf2a Vendoring dependencies
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-20 13:02:10 -07:00
msabansal
7f43fd30f3 DNS support
Signed-off-by: msabansal <sabansal@microsoft.com>
2016-09-20 13:02:02 -07:00
Jana Radhakrishnan
f34bd07737 Merge pull request #1449 from sanimej/ingress
Name the ingress sandbox explicitly
2016-09-20 11:39:57 -07:00
Santhosh Manohar
5d42dc016e Merge pull request #1453 from aboch/enc
In overlay driver reset any state on setkey()
2016-09-19 17:56:28 -07:00
Santhosh Manohar
92e09c53d8 Merge pull request #1446 from mrjana/networkdb
Recover from transient gossip failures
2016-09-19 17:56:02 -07:00
Jana Radhakrishnan
5f5dad3c02 Recover from transient gossip failures
Currently if there is any transient gossip failure in any node the
recoevry process depends on other nodes propogating the information
indirectly. In cases if these transient failures affects all the nodes
that this node has in its memberlist then this node will be permenantly
cutoff from the the gossip channel. Added node state management code in
networkdb to address these problems by trying to rejoin the cluster via
the failed nodes when there is a failure. This also necessitates the
need to add new messages called node event messages to differentiate
between node leave and node failure.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-19 15:58:14 -07:00
Alessandro Boch
d4f3963a26 In overlay driver reset any state on setkey()
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-19 14:03:55 -07:00
Jana Radhakrishnan
ae98412893 Merge pull request #1451 from sanimej/name
Make nodenames unique in Gossip cluster
2016-09-19 11:55:13 -07:00
Santhosh Manohar
5b632d752c Make nodenames unique in Gossip cluster
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-19 09:57:23 -07:00
Santhosh Manohar
04f63f7923 Merge pull request #1433 from mrjana/overlay
Ensure purging neighbor cache for stale deletes
2016-09-16 13:32:06 -07:00
Santhosh Manohar
eb1f7dd441 Merge pull request #1448 from aboch/pnc
Check if IPv6 is enabled before restoring the network pools
2016-09-16 10:02:11 -07:00
Santhosh Manohar
e31db5d6af Name the ingress sandbox explicitly
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-15 15:22:57 -07:00
Alessandro Boch
989d9b2cc4 Check if IPv6 is enabled before restoring the network pools
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-15 11:21:33 -07:00
Madhu Venugopal
4e9df02c8f Merge pull request #1444 from aboch/bs
Fix bitseq.SetAnyInRange
2016-09-14 14:38:30 -07:00
Jana Radhakrishnan
043f0fdec1 Merge pull request #1445 from sanimej/revertlb
Revert "Add sandbox API for task insertion to service LB and service discovery"
2016-09-14 14:32:29 -07:00
Jana Radhakrishnan
a1760284b6 Merge pull request #1367 from stapelberg/ipv6
portmapper: touch iptables only for IPv4
2016-09-14 08:49:03 -07:00
Santhosh Manohar
c9bf3b594e Revert "Add sandbox API for task insertion to service LB and service discovery"
This reverts commit 8298e278be.

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-14 08:44:20 -07:00
Alessandro Boch
f43e4ec066 Fix bitseq.SetAnyInRange
- size 1 range is a valid input

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-13 11:52:12 -07:00
Jana Radhakrishnan
c69d42d6b8 Update Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-12 15:32:19 -07:00
Jana Radhakrishnan
ff59f1baab Serialize dynamic network creation
When dynamic networks are created and there is a race in creation of the
same network from two different tasks then one of them will fail while
the other will succeed. For service tasks this is not a big problem
because they will be rescheduled again. But for attachment tasks this
can be a problem since they won't get recreated and making the whole
connection fail. Fixed it by serializing network creation for the
network with the same id and trying to see if the id is present after
coming out of wait.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-12 15:24:38 -07:00
Madhu Venugopal
cc0095b03e Merge pull request #1441 from sanimej/ndots2
Drop queries in root domain when ndots is set
2016-09-12 15:16:18 -07:00
Santhosh Manohar
db9a7021ac Drop queries in root doamin when ndots is set
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-12 14:25:05 -07:00
Madhu Venugopal
d67eb59295 Merge pull request #1416 from sanimej/health
Add sandbox method for task insertion to service LB and service disovery
2016-09-10 05:55:14 -07:00
Michael Holzheu
8d63e73522 Revert "add s390x arch build info at the netlink_deprecated_linux bridge driver"
This reverts commit b042dbe312.

The original commit breaks s390x, for example Docker build fails:

 * https://github.com/docker/docker/issues/26440

As discussed in the above issue:

  Even though char is unsigned by default on s390x, (gcc)go forces the type
  of RawSockaddr.Data to be signed.

  It makes no practical difference if these fields are signed or unsigned,
  it's just an API issue.

  The (assumed) reason for the original commit:

  For a while RawSockaddr.Data was unsigned during development of the gcc
  s390x port (not in an upstream release though). Probably the patch has
  been developed in this time frame.

Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
2016-09-09 18:04:45 +02:00
Santhosh Manohar
8298e278be Add sandbox API for task insertion to service LB and service discovery
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-09-08 17:39:45 -07:00
Alexander Morozov
56175d6f97 add missed defer to unlock
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-09-08 12:22:20 -07:00
Chun Chen
71b8749971 Merge pull request #1301 from mountkin/keep-custom-bridge
don't delete the bridge interface if it was not created by libnetwork
2016-09-08 10:27:44 +08:00
Jana Radhakrishnan
ad10ae9b3b 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
68ed10ff07 Update Godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 13:47:42 -07:00
Jana Radhakrishnan
f5516d817d Add mflag package locally to libnetwork
Since docker/docker removed mflag package and libnetwork relies on it
create a copy of mflag package in libnetwork project.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 13:47:32 -07:00
Santhosh Manohar
7a71a4ab83 Merge pull request #1426 from mrjana/bugs
Decrement epCnt only after all cleanup
2016-09-07 13:25:28 -07:00
Jana Radhakrishnan
56de900a7b Decrement epCnt only after all cleanup
Currently the endpoint count is being decremented before the driver
cleanup and more importantly before releasing the ip address. This is
racy as it creates a time window where we already have decremented the
endpoint count and so the network can be deleted now. But we haven't
released the IP address yet and the pool is already gone. Although there
is no harm done since the pool is already gone. it generates unnecessary
error message about not able to release the address. Also if the driver
cleanup fails we really should not decrement endpoint count.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 11:33:29 -07:00
Jana Radhakrishnan
2ba6c399ea Ensure purging neighbor cache for stale deletes
When stale delete notifications are received, we still need to make sure
to purge sandbox neighbor cache because these stale deletes are most
typically out of order delete notifications and if an add for the
peermac was received before the delete of the old peermac,vtep pair then
we process that and replace the kernel state but the old neighbor state
in the sandbox cache remains. That needs to be purged when we finally
get the out of order delete notification.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-07 10:45:40 -07:00
Shijiang Wei
6bd15397b2 don't delete the bridge interface if it was not created by libnetwork
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-09-07 14:08:08 +08:00
Tonis Tiigi
d46e5c83dd Remove pkg/tlsconfig dependency
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2016-09-06 14:10:58 -07:00
Alessandro Boch
4b242c61d9 Merge pull request #1430 from mountkin/verify-br
make sure the user-provided bridge interface is a bridge
2016-09-06 13:44:50 -07:00
Shijiang Wei
6205a5d616 make sure the user-provided bridge interface is a bridge
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-09-06 13:14:58 +08:00
Puneet Pruthi
7fac070519 uprev docker/docker/pkg/reexec for libnetwork
Signed-off-by: Puneet Pruthi <puneetpruthi@gmail.com>
2016-09-02 15:30:26 -07:00
Alessandro Boch
f88765e4e6 Merge pull request #1198 from jordimassaguerpla/add_s390x
add s390x arch build info at the netlink_deprecated_linux bridge driver
2016-09-02 22:54:48 +02:00
Madhu Venugopal
e174a7c9f2 Merge pull request #1428 from aboch/sto
Cleanup on error in ProgramExternalConnectivity
2016-09-02 11:54:38 -07:00
Santhosh Manohar
cbf681044f Merge pull request #1369 from aboch/ovl
Allow reattempt of overlay network sbox join
2016-09-02 11:05:32 -07:00
Alessandro Boch
bace4fb6ff Cleanup on error in ProgramExternalConnectivity
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-09-02 11:01:06 -07:00
Jana Radhakrishnan
bf7ef3fd7b Do not hold sandbox if not in distributed control
When the libnetwork controller is not in distributed control mode avoid
retaining stale sandboxes when the network cannot be retrieved from
store. This ratining logic is only applicable for an independent k/v
store which manages libnetwork state. In such case the k/v store may be
temporarily unavailable so there is a need to retain the sandbox so that
the resource cleanup happens properly.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-09-01 14:32:27 -07:00
Jana Radhakrishnan
ddcc220eb7 Adjust WaitForDetachment to also accept networkID
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-31 12:30:18 -07:00
Madhu Venugopal
157483d19d Merge pull request #1411 from dhiltgen/support
Simple support script to gather libnetwork info
2016-08-30 16:04:52 -07:00
Alessandro Boch
2a1ea8a642 Merge pull request #1398 from sanimej/access
Allow reachability across services on the same host
2016-08-30 23:06:12 +02:00
Alessandro Boch
92e20b70e6 Fix potential deadlock in getSvcRecords()
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-08-30 12:40:46 -07:00
Alessandro Boch
622ea9d39a Merge pull request #1419 from mrjana/lb
Do not try LB populate on interface-less endpoint
2016-08-30 21:40:28 +02:00
Jana Radhakrishnan
7912e19488 Fix CircleCI
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-30 12:23:19 -07:00
Jana Radhakrishnan
e7d84635f2 Merge pull request #1418 from sanimej/vxlan
Propage the vxlan device creation error in driver to libnetwork
2016-08-30 11:06:46 -07:00
Jana Radhakrishnan
b551a61694 Do not try LB populate on interface-less endpoint
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-30 09:41:16 -07:00
Santhosh Manohar
416a730dad Allow reachability across services on different networks in the same host
This also allows pubslied services to be accessible from containers on bridge
networks on the host

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-29 22:25:21 -07:00
Jana Radhakrishnan
9041996509 Nil check ingressSandbox before deleting
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-25 22:41:59 -07:00
Jana Radhakrishnan
b29ba21551 Avoid double close of agentInitDone
Avoid by reinitializing the channel immediately after closing the
channel within a lock. Also change the wait code to cache the channel in
stack be retrieving it from controller and wait on the stack copy of the
channel.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-24 14:00:36 -07:00
Daniel Hiltgen
02ef43380e Simple support script to gather libnetwork info
This script gathers some basic information from a system that might
be useful to help troubleshoot problems.  If added into an image
including the proper binaries, running looks something like this:

    docker run --rm \
        -v /var/run/docker.sock:/var/run/docker.sock \
        -v /var/run/docker/netns:/var/run/docker/netns \
        --privileged --net=host nwsupport /bin/support

Signed-off-by: Daniel Hiltgen <daniel.hiltgen@docker.com>
2016-08-23 14:19:33 -07:00
Jana Radhakrishnan
1f4c1cb75c Avoid k/v store endpoint update in swarm mode
Avoid the whole store endpoint update logic when running in swarm mode
and the endpoint is part of a global scope network. Currently there is
no store update that is happening for global scope networks in swarm
mode, but this code path will delete the svcRecords database when the
last endpoint on the network is removed which is something that is not
required.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-23 14:14:11 -07:00
Jana Radhakrishnan
547c342c1b 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
d39893a9a0 Updated godeps
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-22 18:35:53 -07:00
Santhosh Manohar
c5629b7a14 Merge pull request #1408 from mrjana/agent
Notify agentInitDone after joining the cluster
2016-08-22 11:19:42 -07:00
Santhosh Manohar
173832dd19 Merge pull request #1406 from mrjana/bugs
Ensure add newly joined node to networknodes
2016-08-21 22:03:03 -07:00
Santhosh Manohar
10c617ed4d Merge pull request #1407 from mrjana/lb
Cleanup service bindings when leaving cluster
2016-08-21 18:04:09 -07:00
Santhosh Manohar
6f31dee9d1 Merge pull request #1403 from mrjana/networkdb
Ignore delete events for non-existent entries
2016-08-21 17:13:38 -07:00
Santhosh Manohar
ba8714e585 Propage the vxlan device creation error in driver to libnetwork
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-21 15:52:40 -07:00
Jana Radhakrishnan
4f55b50f93 Cleanup service bindings when leaving cluster
When leaving the entire gossip cluster or when leaving a network
specific gossip cluster, we may not have had a chance to cleanup service
bindings by way of gossip updates due to premature closure of gossip
channel. Make sure to cleanup all service bindings since we are not
participating in the cluster any more.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-19 18:11:15 -07:00
Jana Radhakrishnan
8a1092fe78 Notify agentInitDone after joining the cluster
Currently the initDone notification is provided immediately after
initializing the cluster. This may be fine for the first manager. But
for all subsequent nodes which join the cluster we need to wait until
the node completes the joining to the gossip cluster inorder to
synchronize the gossip network clock with other nodes. If we don't have
uptodate clock the updates that this node provides to the cluster may be
discarded by the other nodes if they have entries which are yet to be
reaped but have a better clock.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-19 17:57:58 -07:00
Jana Radhakrishnan
1b027335f1 Ensure add newly joined node to networknodes
In cases a node left the cluster and quickly rejoined before the node
entry is expired by other nodes in the cluster, when the node rejoins we
fail to add it to the quick lookup database. Fixed it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-19 17:18:15 -07:00
Jana Radhakrishnan
2bead02c87 Ignore delete events for non-existent entries
In networkdb we should ignore delete events for entries which doesn't
exist in the db. This is always true because if the entry did not exist
then the entry has been removed way earlier and got purged after the
reap timer and this notification is very stale.

Also there were duplicate delete notifications being sent to the
clients. One when the actual delete event was received from gossip and
later when the entry was getting reaped. The second notification is
unnecessary and may cause issues with the clients if they are not
coded for idempotency.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-18 13:57:24 -07:00
Jana Radhakrishnan
4b80c3411d Cleanup ingress network and sandbox on leave
When a node leaves the swarm cluster, we should cleanup the ingress
network and sandbox. This makes sure that when the next time the node
joins the swarm it will be able to update the cluster with the right
information.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-17 13:48:51 -07:00
Santhosh Manohar
6e965c03ad Reset the encryption keys on swarm leave
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-16 17:37:33 -07:00
Jana Radhakrishnan
30b53a73c1 Merge pull request #1393 from sanimej/2782
Relax SRV name validation and fix external SRV query handling
2016-08-15 16:37:29 -07:00
Jana Radhakrishnan
6d877647e1 Add a narrower SNAT rule for LB egress
The SNAT rules added for LB egress is broader and breaks load balancing
if the service is connected to multiple networks. Make it conditional
based on the subnet to which the network belongs so that the right SNAT
rule gets matched when egressing the corresponding network.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-15 15:38:14 -07:00
Alexander Morozov
55564fda1d network: fix race in read access to map
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-15 14:43:59 -07:00
Santhosh Manohar
149af45509 Relax SRV name validation and fix external SRV query handling
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-14 11:27:07 -07:00
Santhosh Manohar
e28730d44b Fix a panic introduced by #1389
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-11 17:51:13 -07:00
Madhu Venugopal
c7d98e0081 Merge pull request #1382 from mrjana/overlay
Fix spurious overlay errors
2016-08-11 11:38:57 +05:30
Madhu Venugopal
b8b11a0520 Merge pull request #1378 from sanimej/cleanup
Remove unused key handling functions
2016-08-11 11:30:05 +05:30
Santhosh Manohar
cd0b6bac4c For service name DNS resolution prioritize IP on user overlay network
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-10 17:44:33 -07:00
Santhosh Manohar
2bab9b6bdb Cleanup networkdb state when the network is deleted locally
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-10 12:44:05 -07:00
Jana Radhakrishnan
0a1c09d685 Merge pull request #1373 from sanimej/dns
Fix external DNS responses > 512 bytes getting dropped
2016-08-08 11:59:22 -07:00
Jana Radhakrishnan
b7fe572598 Merge pull request #1376 from technolo-g/master
Fix typo in error message
2016-08-08 11:58:13 -07:00
Jana Radhakrishnan
004e56a4d1 Fix spurious overlay errors
Fixed certain spurious overlay errors which were not errors at all but
showing up everytime service tasks are started in the engine.

Also added a check to make sure a delete is valid by checking the
incoming endpoint id wih the one in peerdb just to make sure if the
delete from gossip is not stale.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-08 11:55:06 -07:00
Santhosh Manohar
06e19a789f Merge pull request #1377 from mrjana/bugs
Make service LB work from self
2016-08-05 16:16:53 -07:00
Jana Radhakrishnan
e5bf276745 Merge pull request #1381 from LK4D4/fix_overlay_race
overlay: fix data race in map access
2016-08-05 16:16:27 -07:00
Alexander Morozov
09da6a6f59 overlay: fix data race in map access
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-05 14:40:23 -07:00
Alexander Morozov
392b089170 networkdb: fix data races in map access
Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-08-05 14:24:30 -07:00
Santhosh Manohar
ab02b015ef Remove unused key handling functions
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-05 04:46:01 -07:00
Jana Radhakrishnan
aced41a3d2 Make service LB work from self
Make service loadbalancing to work from within one of the containers of
the service. Currently this only works when the loadbalancer selects the
current container. If another container of the same service is chosen,
the connection times out. This fix adds a SNAT rule to change the source
IP to the containers primary IP so that responses can be routed back to
this container.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-04 17:39:38 -07:00
Matt Bajor
d19e1f22cb Fix typo in error message
Signed-off-by: Matt Bajor <matt@notevenremotelydorky.com>
2016-08-04 15:58:39 -06:00
Jana Radhakrishnan
cd488c6d18 Do not add ingress loadbalancer on service tasks
Ingress loadbalancer is only required to be plumbed in ingress sandboxes
of nodes which are the only mechanism to get traffix outside the cluster
to tasks. Since the tasks are part of ingress network, these
loadbalancers were getting added in all tasks which are exposing ports
which is totally unnecessary resource usage. This PR avoids that.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-04 14:20:54 -07:00
Jana Radhakrishnan
0030332e4e Merge pull request #1372 from sanimej/gossip
Add container short-id as an alias for swarm mode tasks
2016-08-03 17:27:49 -07:00
Santhosh Manohar
785f7aa254 Merge pull request #1371 from aaronlehmann/check-key-slice
Check size of keys slice
2016-08-03 14:24:06 -07:00
Santhosh Manohar
bd5051931f Fix external DNS responses > 512 bytes getting dropped
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-03 05:29:32 -07:00
Santhosh Manohar
901a26f10f Merge pull request #1370 from mrjana/lb
Make sure to not remove backends on stale notices
2016-08-03 02:38:42 -07:00
Santhosh Manohar
b54a4b5936 Add container short-id as an alias for swarm mode tasks
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-02 20:28:33 -07:00
Santhosh Manohar
cfd97fc7d2 Godep update for gogo/protobuf components
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-08-02 20:10:54 -07:00
Aaron Lehmann
3f542419ac Check size of keys slice
If not enough keys are provided to SetKeys, this may cause a panic. This
should not cause problems with the current integration in Docker 1.12.0,
but the panic might happen loading data created by an earlier version,
or data that is corrupted somehow. Add a length check to be defensive.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-08-02 19:07:43 -07:00
Madhu Venugopal
c9eb73fccc Merge pull request #1365 from sanimej/gossip
Do not create network entry for the local node in the db based on peer's state sync.
2016-08-02 14:49:44 -07:00
Jana Radhakrishnan
82457d17b0 Make sure to not remove backends on stale notices
Sometimes you may get stale backend removal notices from gossip due to
some lingering state. If a stale backend notice is received and it is
already processed in this node ignore it rather than processing it.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-02 14:19:22 -07:00
Jana Radhakrishnan
91ec1a2cf4 Ensure drivertable entries in joininfo is uptodate
The CopyTo function for joininfo is not copying the driver table entries
which then is missing when the endpoint is re-read for the store cache.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-08-02 14:06:41 -07:00
Jana Radhakrishnan
8825f80d8c Merge pull request #1366 from allencloud/fix-typo-in-comment-and-log
fix typo in comments and log
2016-08-01 09:50:26 -07:00
Jana Radhakrishnan
8a225de00d Merge pull request #1205 from allencloud/fix-typos
use grep to find a/an misuse
2016-08-01 09:49:31 -07:00
Jana Radhakrishnan
b0f5f02224 Merge pull request #1284 from liubin/fix-typos
fix typos
2016-08-01 09:49:00 -07:00
Jana Radhakrishnan
4a853b3c8c Merge pull request #1308 from leecalcote/patch-2
docs/ipam.md: spelling error
2016-08-01 09:48:23 -07:00
Jana Radhakrishnan
e5deaf0c8a Merge pull request #1343 from ericho/remove_comment_libnetwork_tests
Remove commented code from libnetwork_test.go
2016-08-01 09:46:49 -07:00
Alessandro Boch
4f8c645173 Allow reattempt of overlay network sbox join
- if failure happened during restore endpoint phase

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-08-01 08:08:51 -07:00
Michael Stapelberg
1b899469a6 portmapper: touch iptables only for IPv4
split out of https://github.com/docker/docker/pull/20315
in order to fix https://github.com/docker/docker/issues/11518

Signed-off-by: Michael Stapelberg <stapelberg@google.com>
2016-07-31 00:29:24 +02:00
allencloud
d69747e19e fix typo in comments and log
Signed-off-by: allencloud <allen.sun@daocloud.io>
2016-07-30 02:21:10 +08:00
Thomas Graf
7acedb94f3 Fix crash when remote plugin returns empty address string
If a remote plugin returns an empty string in response to RequestAddress(),
the internal helper will return nil which will crash libnetwork in several
places.

Treat an empty string as a new error ipamapi.ErrNoIPReturned.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
2016-07-29 10:45:48 +02:00
Madhu Venugopal
83b0be7f1a Check for isAgent() outside the network lock to avoid deadlocks
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-28 11:33:21 -07:00
Madhu Venugopal
849712f35d Better error handling in restoring sandbox states
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-27 00:55:46 -07:00
Santhosh Manohar
8af5fdb9b1 Do not create network entry in networkdb for the local node based on table
event from peer

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-07-26 06:51:47 -07:00
Madhu Venugopal
f142339334 Merge pull request #1356 from aboch/isb
Fix bug in ipsec key rotation
2016-07-25 19:16:01 -07:00
Alessandro Boch
bc6a60dae5 Fix bug in ipsec key rotation
- which would leave a stale state behind
  at each key rotation.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-25 16:23:53 -07:00
Alessandro Boch
8bc99ae906 Check for advertise IP when deriving ipsec nodes
- We need to compare the node notification IP with
  the advertise address otherwise when the advertise
  address is different from the local address (this
  is for the public address outside of the host
  that maps 1-to-1 to the local private address)
  the local IP will be acocunted as an ipsec host
  and extra states will be programmed for it.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-25 12:07:48 -07:00
Alessandro Boch
88b76892f3 Merge pull request #1352 from sanimej/cache
Remove UDP connection caching in embedded DNS server
2016-07-24 17:06:05 -07:00
Madhu Venugopal
cd8a75e237 Merge pull request #1350 from aboch/ipsec
On network creation, reset mangle rule
2016-07-24 08:54:50 -07:00
Alessandro Boch
147b646e79 On network creation, reset mangle rule
- When creating a non encrypted overlay network,
  make sure no encryption related mangle rule from
  stale network is on the way.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-24 08:25:47 -07:00
Madhu Venugopal
7c3bbb4593 Merge pull request #1351 from sanimej/edns
Send truncated external responses to the client
2016-07-24 07:41:49 -07:00
Alessandro Boch
801bd7b3b2 Allow user to set the overlay network's mtu
- Being a driver specific flag, user needs to
  account for vxlan and, if enabled, ipsec overhead

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-23 22:39:29 -07:00
Madhu Venugopal
ebdbea8224 Merge pull request #1341 from aboch/sec
Do not force ipv4 addresses to canonical form in overlay enc
2016-07-23 22:16:40 -07:00
Alessandro Boch
e415b1f495 Do not use 4 byte ip addresses in encryption code
- Because of a bug in the netlink xfrm code, our code will
  fail to find and remove the states. While we could wait
  for the netlink library fix, there is no longer a need to
  convert the parsed IP addresses to the canonical notation
  given the previous SPI computation (which worked on that
  4 byte address assumption) is now replaced by the fnv hash.
- Also modify driver option that enables ipsec to "encrypted"

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-23 19:00:47 -07:00
Santhosh Manohar
44fabf5343 Remove UDP connection cachig in embedded DNS server
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-07-23 09:05:49 -07:00
Santhosh Manohar
b2603e895a Send truncated external responses to the client
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-07-23 02:56:31 -07:00
Madhu Venugopal
5fee2c5be9 Merge pull request #1347 from sanimej/sd
Update service DB on deletion of containers in bridge networks
2016-07-22 17:51:28 -07:00
Madhu Venugopal
d6fefd1ad8 Merge pull request #1346 from aboch/lk
Lock in isAgent() and inMaster()
2016-07-22 17:50:39 -07:00
Santhosh Manohar
902ead3109 Update service DB on deletion of containers in bridge networks
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2016-07-22 14:51:36 -07:00
Alessandro Boch
3c36b06cb3 Lock in isAgent() and inMaster()
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-22 14:21:28 -07:00
Jordi Massaguer Pla
b042dbe312 add s390x arch build info at the netlink_deprecated_linux bridge driver
Signed-off-by: Jordi Massaguer Pla <jmassaguerpla@suse.de>
2016-07-22 12:30:16 +02:00
Erich Cordoba
df728f4e0c Remove commented code from libnetwork_test.go
Signed-off-by: Erich Cordoba <erich.cm@yandex.com>
2016-07-21 23:37:54 -05:00
Madhu Venugopal
605ecdd099 Merge pull request #1340 from aboch/restart
Save the controller config on config reload
2016-07-21 15:41:31 -07:00
Alessandro Boch
43df8050ba Merge pull request #1335 from ericho/macvlan-doc-typos
Fix several typos on macvlan docs
2016-07-21 13:24:56 -07:00
Alessandro Boch
47c071b654 Save the controller config on config reload
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-21 12:09:07 -07:00
Alessandro Boch
6b486d88e6 Merge pull request #1337 from mavenugo/adv-addr
Add advertise-addr support
2016-07-21 09:51:51 -07:00
Madhu Venugopal
6368406c26 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
Madhu Venugopal
46caa4c813 Merge pull request #1339 from aboch/sec
Adjust container's veth MTU when encryption is on
2016-07-21 01:43:18 -07:00
Alessandro Boch
c0864059a7 Merge pull request #1329 from mavenugo/execroot
Make osl sandbox basepath configurable using --exec-root configuration
2016-07-20 18:28:21 -07:00
Madhu Venugopal
9b822c3fc6 Merge pull request #1327 from aboch/aead
Use Authenticated Encryption for dataplane encryption
2016-07-20 17:36:31 -07:00
Alessandro Boch
6aa25f33d4 Adjust container's veth MTU when encryption is on
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-20 17:13:05 -07:00
Alessandro Boch
ddff1b5a87 Use fnv1-a to construct the SPI
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-20 12:50:33 -07:00
Vladislav Kolesnikov
7301999c2a added locks for all other accesses to controller.svcRecords
Signed-off-by: Vladislav Kolesnikov <vkolesnikov@beget.ru>
2016-07-20 19:49:59 +03:00
Vladislav Kolesnikov
1e0c61c3a2 added mutex on read from controller.svcRecords map
Signed-off-by: Vladislav Kolesnikov <vkolesnikov@beget.ru>
2016-07-20 17:28:32 +03:00
Erich Cordoba
829a4ee4be Fix several typos on macvlan docs
Signed-off-by: Erich Cordoba <erich.cm@yandex.com>
2016-07-19 21:14:57 -05:00
Alessandro Boch
253c103b8c Use aead for dataplane encryption
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-19 11:48:28 -07:00
Alexander Polakov
daf4c97f7a Actually retry LinkSetUp
Signed-off-by: Alexander Polakov <plhk@sdf.org>
2016-07-19 14:20:45 +03:00
Lei Jitang
744d5332bd ipvlan: remove endpoint from network on deleting endpoint
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-19 00:06:46 -04:00
Madhu Venugopal
7b470ea14d Merge pull request #1326 from coolljt0725/fix_update_endpoint_cnt
Fix update endpoint count to store
2016-07-18 13:54:42 -07:00
Madhu Venugopal
25f0573785 Make osl sandbox basepath configurable via execroot.
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-18 05:14:39 -07:00
Alessandro Boch
0b0678677f Update vishvananda/netlink to e73bad4
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-17 21:32:53 -07:00
Madhu Venugopal
32e08e7700 Moving the UDS file out of /var/lib/docker and into /run/
the UDS sock is an unique file and the lifetime of it is until the
docker daemon dies (gracefully). Hence there is no need for it to be
under /var/lib and not mandatory to be configurable either.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-15 13:38:23 -07:00
Lei Jitang
4999c5707d Fix endpoint cnt decline overflow
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-14 22:52:44 -04:00
Lei Jitang
804f93bdff Fix update endpoint cnt to store
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2016-07-14 22:51:06 -04:00
Madhu Venugopal
cc69d2452c Merge pull request #1324 from aboch/ovcn
Overlay driver to cleanup stale endpoints
2016-07-14 13:23:55 -07:00
Alessandro Boch
46f525c7d6 Overlay driver to cleanup stale endpoints
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-13 10:56:57 -07:00
Madhu Venugopal
68e53443c9 Merge pull request #1323 from aboch/sbr
Return proper error types on sandbox creation
2016-07-12 21:33:30 -07:00
Alessandro Boch
2e88dfa406 Return proper error types on sandbox creation
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-12 21:02:10 -07:00
Alessandro Boch
8fbad4ba05 Merge pull request #1321 from mavenugo/secaddr
Add Virtual-IP of an endpoint as a secondary IP
2016-07-12 20:03:14 -07:00
Alessandro Boch
d0192db0cd On agent init, re-join on existing cluster networks
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-07-12 17:35:32 -07:00
Madhu Venugopal
f0292e04b8 Add Virtual-IP of an endpoint as a secondary IP
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-12 15:50:42 -07:00
Alessandro Boch
e4957174ee Merge pull request #1318 from mavenugo/nscope
manage network dynamic flag appropriately under various scenarios
2016-07-12 10:00:20 -07:00
Madhu Venugopal
9d01c1fcd5 manage network dynamic flag appropriately under various scenarios
If a network is dynamic, make sure the scope of the object doesnt change
based on the cluster-mode

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-12 08:57:50 -07:00
Alexander Morozov
af3158ecdb networkdb: do nothing in bulkSync if nodes is empty
This patch allows getting rid of annoying debug message.

Signed-off-by: Alexander Morozov <lk4d4math@gmail.com>
2016-07-11 09:11:07 -07:00
Andy Lindeman
f2ae8467e3 Avoids panic when checking for conflicts against an uninitalized network
A network is added to the `d.networks` map before it's fully initialized. That
is, it's possible for a network in `d.networks` to exist without having
`bridgeIPv4` populated yet. If multiple networks are spun up close to the same
time, a panic can occur.

Example:
```
panic(0x1a75d20, 0xc82000e090)
        /usr/local/go/src/runtime/panic.go:443 +0x4e9
net.networkNumberAndMask(0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
        /usr/local/go/src/net/ip.go:433 +0x42
net.(*IPNet).Contains(0x0, 0xc82084dbd0, 0x4, 0x4, 0xc820010200)
        /usr/local/go/src/net/ip.go:457 +0x25
github.com/docker/libnetwork/drivers/bridge.(*networkConfiguration).conflictsWithNetworks(0xc822249360, 0xc822761380, 0x40, 0xc820866a60, 0x4, 0x4, 0x0, 0x0)
        /root/rpmbuild/BUILD/docker-engine/vendor/src/github.com/docker/libnetwork/drivers/bridge/bridge.go:334 +0x40b
```

Signed-off-by: Andy Lindeman <alindeman@salesforce.com>
2016-07-07 11:27:12 -04:00
Madhu Venugopal
630e106529 Merge pull request #1230 from justincormack/proxy
Make the docker proxy a standalone binary not a re-exec
2016-07-06 11:38:06 -07:00
Alessandro Boch
83be979887 Merge pull request #1310 from mavenugo/drvRegIpam
Moving IPAM initalization out of drvRegistry into libnetwork core
2016-07-05 17:56:47 -07:00
Madhu Venugopal
576267bfb9 Moving IPAM initalization out of drvRegistry into libnetwork core
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2016-07-05 16:42:34 -07:00
Madhu Venugopal
68be2ca7e4 Merge pull request #1304 from dmcgowan/fix-fd-leaks
Fix file descriptor leaks
2016-07-05 14:07:04 -07:00
Justin Cormack
5202f95604 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
Derek McGowan
ccabedfbe3 Fix file descriptor leaks
Ensures network connections and file are closed when done writing.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-07-01 16:29:51 -07:00
Lee Calcote
dc4487dbb0 docs/ipam.md: spelling error
Changed "lifecyle" to "lifecycle".

Signed-off-by: Lee Calcote <leecalcote@gmail.com>
2016-07-01 11:03:54 -05:00
Jana Radhakrishnan
8936daab5e Retain deleted entries for longer time
When deleting entries or when learning about deleted entries remember
then for a longer time to avoid excessive delete duplicates in the
gossip cluster. Also added code changes to ignore event messages
originated from the source node so that it doesn't get added into the
rebroadcast queue.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-30 18:24:13 -07:00
Alessandro Boch
e942cb3dd6 Merge pull request #1294 from sanimej/ipseckeys
Switch overlay encryption to use IPSec subsystem keys
2016-06-29 17:23:34 -07:00
Jana Radhakrishnan
2988086ab1 Do not remove service record while scaling down
While scaling down, currently we are removing the service record even if
the LB entry for the vip is not fully removed. This causes resolution
issues when scaling down. Fixed it by removing the service record only
if the LB for the vip is going away.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-29 11:51:32 -07:00
Madhu Venugopal
29f758f532 Merge pull request #1292 from mrjana/lb
Index service on both id and portconfigs
2016-06-28 16:52:17 -07:00
Jana Radhakrishnan
de766cc7e6 ovmanager: Error out on vxlan id alloc failure
Currently ovmanager simply logs an error when there is a vni allocation
failure. Instead it should error out and free all the previously
allocated vnis

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-28 13:46:22 -07:00
Jana Radhakrishnan
bc89397105 Index service on both id and portconfigs
While trying to update loadbalancer state index the service both on id
and portconfig. From libnetwork point of view a service is not just
defined by its id but also the ports it exposes. When a service updates
its port its id remains the same but its portconfigs change which should
be treated as a new service in libnetwork in order to ensure proper
cleanup of old LB state and creation of new LB state.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-27 15:37:22 -07:00
Madhu Venugopal
b3fc24768b Merge pull request #1285 from aboch/loc
Remove locator check on endpoint force removal
2016-06-27 14:46:21 -07:00
Alessandro Boch
37d8df2b0b Merge pull request #1300 from cpuguy83/fix_bridge_ep_panic
Fix panic calling `ep` instead of `endpoint`
2016-06-27 11:08:14 -07:00
Jana Radhakrishnan
3c8ea96159 Merge pull request #1289 from clinta/1288
Make sure route selected is direct
2016-06-27 10:43:35 -07:00
Brian Goff
3925ea0a2d Fix panic calling ep instead of endpoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-06-27 13:25:20 -04:00
Alessandro Boch
5146f05b33 Do not error on non discovery type messages in remote driver
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-25 16:23:11 -07:00
Jana Radhakrishnan
d3b8412ac6 Update ovmanager to support maximum vni
To support maximum possible overlay networks in swarm mode.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2016-06-24 16:41:53 -07:00
Aaron Lehmann
91e8d5bfb9 Fix sanbox typo
Change "sanbox" to "sandbox".

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-06-24 15:14:01 -07:00
Jana Radhakrishnan
d82e80e221 Merge pull request #1206 from jimmycmh/master
Remove Lock in datastore for global scope
2016-06-24 06:38:05 -07:00
Clint Armstrong
fa68f9d017 Make sure route selected is direct
Signed-off-by: Clint Armstrong <clint@clintarmstrong.net>
2016-06-23 16:23:47 -04:00
menghui.chen
115cdb52b3 Remove Lock in datastore for global scope
Signed-off-by: menghui.chen <menghui.chen@alibaba-inc.com>
2016-06-23 14:22:58 +08:00
Alessandro Boch
64673bce0a Remove locator check on endpoint force removal
- If an endpoint is forcibly removed, it should not
  matter whether the locator info is present. If
  the daemon was started w/o the --cluster-advertise
  option (the option is not mandatory), then the
  locator would be empty for any endpoint.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-22 18:34:30 -07:00
Alessandro Boch
ba36e2b75e Merge pull request #1286 from nerdalert/vlan_doc
Fixed missing v6 enable flag in macvlan doc
2016-06-22 17:05:44 -07:00
Brent Salisbury
500a255181 Fixed missing v6 enable flag in macvlan doc
Signed-off-by: Brent Salisbury <brent@docker.com>
2016-06-22 19:59:55 -04:00
Alessandro Boch
23830083ea Merge pull request #1282 from sanimej/lateread
For cached connections ignore late replies after read timeout
2016-06-22 08:17:42 -07:00
Alessandro Boch
382aefbeb5 Merge pull request #1279 from BSWANG/master
make sure interface up successful
2016-06-22 08:17:28 -07:00
bin liu
5f7577bbb4 fix typos
Signed-off-by: bin liu <liubin0329@gmail.com>
2016-06-22 14:20:30 +08:00
Alessandro Boch
0c9b6e44dd Merge pull request #1283 from sanimej/keys
Add debugs for key change events in networkdb
2016-06-21 18:27:03 -07:00
Santhosh Manohar
dd19ad27d8 Merge pull request #1281 from aboch/vnd
Gracefully handle missing xfmr modules and netlink vendor
2016-06-21 13:49:28 -07:00
bingshen.wbs
93cada0d94 make sure interface up successful
Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2016-06-21 14:28:13 +08:00
Alessandro Boch
117131c41b Gracefully handle missing xfrm modules
If xfrm modules cannot be loaded:
- Create netlink.Handle only for ROUTE socket
- Reject local join on overlay secure network

Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 17:25:32 -07:00
Alessandro Boch
b39f13f80e Update vishvananda/netlink 734d02c
Signed-off-by: Alessandro Boch <aboch@docker.com>
2016-06-20 12:54:58 -07:00
Brent Salisbury
165a1f6021 Added docs for macvlan driver
Signed-off-by: Brent Salisbury <brent@docker.com>
2016-06-20 05:55:45 -04:00