Commit Graph

656 Commits

Author SHA1 Message Date
David Calavera 69db893063 Do not print the word nil in a log.
Because it doesn't mean anything.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-02 08:48:45 -07:00
Madhu Venugopal dcf0b872c9 Merge pull request #481 from mrjana/bugs
Allow tests to be interrupted
2015-09-01 23:16:54 -07:00
Jana Radhakrishnan 6c86687908 Merge pull request #472 from cloudflare/remap-lock
lock port mapper when reapplying iptables rules
2015-09-01 22:00:49 -07:00
Madhu Venugopal a78f8c1d95 Merge pull request #479 from aboch/rhh
Add Refresh() to Sandbox
2015-09-01 21:54:37 -07:00
Alessandro Boch fe3e63908c Add Refresh() to Sandbox
- Convinience API which detaches the sandbox from
  all endpoints, resets and reapply config options,
  setup discovery files, reattach to the endpoints.
  No change to the osl sandbox in use.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-09-01 21:48:14 -07:00
Jana Radhakrishnan 2528ec57ff Allow tests to be interrupted
Currently when libnetwork tests are run inside a container
you cannot interrupt them in the middle by pressing ctrl-c
even though all the tests run in foreground. Fix this by running
tests by wrapping the make invocation inside the container
with a shell scripts which installs the SIGINT handler.
Without the handler the kernel does not deliver signals
to the process with PID 1(which in this case was make itself)
and hence make could never be interrupted. With this fix
we capture SIGINT in the shell script and re-raise it in the
the child process (which is make) and that makes the make
interruptible.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-01 21:48:09 -07:00
Jana Radhakrishnan 3eb8c22b9b Merge pull request #478 from aboch/sx
Fix resolv.conf and hosts handling in sandbox
2015-09-01 17:39:10 -07:00
Alessandro Boch e7849cbfe6 Fix resolv.conf and hosts handling in sandbox
Two issues:
- container resolv.conf getting regenerated even when no dns configs are passed
- updateHosts should be skipped for host networking mode
- incorrect check on dnsOptions

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-09-01 17:22:28 -07:00
Madhu Venugopal a79cdb47d8 Merge pull request #471 from chenchun/fix_mismatch_type_panic
Fix panic due to mismatched types
2015-09-01 17:21:45 -07:00
Madhu Venugopal 0a62c10f84 Merge pull request #476 from mrjana/bugs
Explicitly set namespace for all network operations
2015-09-01 16:39:39 -07:00
Jana Radhakrishnan b784a13c94 Explicitly set namespace for all network operations
Make sure to always explicitly set namespace for all
kernel bound network operations irrespective of whether
the operation is performed in init namespace or a user
defined namespace. This already happens for user defined
netns. But doesn't happen for initial netns that libnetwork
runs in.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-01 14:00:58 -07:00
Madhu Venugopal b3867ac7d7 Merge pull request #467 from thockin/14069-dns-options
Add DNS 'options' support
2015-08-30 12:44:38 -07:00
Madhu Venugopal e8f3c15beb Merge pull request #473 from brahmaroutu/fix_ibm_power
Adding ppc64le build tag to compile on IBM Power
2015-08-30 12:43:06 -07:00
Madhu Venugopal b7d5d9fac8 Merge pull request #470 from WeiZhang555/master
fix typo
2015-08-30 12:42:14 -07:00
Tim Hockin 0d7605233b Add DNS 'options' support
This is needed to expose DNS options like 'ndots' into containers.

https://github.com/docker/docker/issues/14069

Signed-off-by: Tim Hockin <thockin@google.com>
2015-08-28 09:19:33 -07:00
Jana Radhakrishnan b1992c8969 Merge pull request #365 from aboch/netc
Introduce Sandbox entity
2015-08-27 17:13:54 -07:00
Alessandro Boch 9a47be244a Introduce Sandbox entity
- Maps 1 to 1 with container's networking stack
- It holds container's specific nw options which
  before were incorrectly owned by Endpoint.
- Sandbox creation no longer coupled with Endpoint Join,
  sandbox and endpoint have now separate lifecycle.
- LeaveAll naturally replaced by Sandbox.Delete
- some pkg and file renaming in order to have clear
  mapping between structure name and entity ("sandbox")
- Revisited hosts and resolv.conf handling
- Removed from JoinInfo interface capability of setting hosts and resolv.conf paths
- Changed etchosts.Build() to first write the search domains and then the nameservers

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 11:19:02 -07:00
Srini Brahmaroutu cb678f55ee Adding ppc64le build tag to compile on IBM Power
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-08-27 04:18:34 +00:00
Daniel Dao ec0c66902e lock port mapper when reapply iptables rules
Make sure that port mapper state is not updated while we are trying to remap
everything.

Signed-off-by: Daniel Dao <dqminh@cloudflare.com>
2015-08-26 22:12:40 +00:00
Chun Chen b7d723c664 Fix panic due to mismatched types
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-08-26 11:30:17 +08:00
Jana Radhakrishnan 5b6fe2e705 Merge pull request #469 from sanimej/ov-mac
Overlay driver should assign interface mac based on the IP
2015-08-25 11:05:08 -07:00
Zhang Wei d46070908b fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-26 00:41:32 +08:00
Jana Radhakrishnan 0dca75517b Merge pull request #442 from aboch/csb
Simplify NetworkOverlaps function
2015-08-18 09:04:02 -07:00
Madhu Venugopal 9584da3e16 Merge pull request #317 from aboch/no
bitseq refactor
2015-08-16 18:13:14 -07:00
Alessandro Boch e4c2d554bc Fix ip range allocation in ipam
- Current logic about valid addresses is wrong

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch 4e48ff3aab Fix preferred ip allocation in ipam
- also provided a new utility to compute the
  host part ip address which is resilient to
  input passed in different representations.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch fa75dc24c4 idm and ipam to use bitseq atomic APIs
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch ffd7952f64 bitseq to provide atomic functions
- Also add validation for passed ordinal

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch 05efb232d0 bitseq to only handle and return unsigned types
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch a5fb461351 Control exported types in bitseq
- bitseq users only need to know Handle type

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Alessandro Boch e295febf03 network byte order to bitseq serializer
Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-16 09:38:17 -07:00
Madhu Venugopal 7204731c4d Merge pull request #457 from WeiZhang555/typo
Fix typo
2015-08-15 07:52:20 -07:00
Zhang Wei 89b183f9a1 Fix typo
Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-08-15 15:48:14 +08:00
Santhosh Manohar 46a4bde982 Overlay driver should assign interface mac based on the IP
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-08-14 23:59:02 -07:00
aboch 0a5aca96e1 Merge pull request #456 from mrjana/bugs
Update vishvananda/netlink
2015-08-14 18:08:49 -07:00
Jana Radhakrishnan 15fcb1ea06 Update vishvananda/netlink
Update netlink package to fix some critical
netlink issues.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-08-14 18:01:15 -07:00
Madhu Venugopal 22dc04d060 Merge pull request #454 from mrjana/overlay
Fix racy joinSandbox behavior
2015-08-13 15:26:22 -07:00
Jana Radhakrishnan af4e676550 Fix racy joinSandbox behavior
The current lazy network sandbox initialization code has a race
in that if multiple go routines race to join the network the second
and subsequent go routines might try to use the sandbox before it is
fully initialized. Fix this by blocking the go routines in once.Do
calls and also take of care of rolling back properly in case of
error.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-08-13 14:55:16 -07:00
Madhu Venugopal 1fde5d5dd0 Merge pull request #285 from lindenlab/custom-host-port-ranges
Adding libnetwork support to publish on custom host port ranges.
2015-08-12 16:01:44 -07:00
aboch b642de8d76 Merge pull request #447 from sanimej/libn-exp-local
Pass the vxlan port in network endian order
2015-08-07 17:36:33 -07:00
Don Kjer 56921c850e Adding libnetwork support to publish on custom host port ranges.
See https://github.com/docker/docker/pull/12927 for docker portion.

Signed-off-by: Don Kjer <don.kjer@gmail.com>
2015-08-08 00:23:03 +00:00
aboch aff4face68 Merge pull request #448 from mavenugo/nl_godep
Updated Godeps to the latest vishvanandha/netlink
2015-08-07 16:58:02 -07:00
Madhu Venugopal 9754be0f4a Updated Godeps to the latest vishvanandha/netlink
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-08-07 16:40:32 -07:00
Santhosh Ram Manohar edc929bb05 Pass the vxlan port in network endian order
Signed-off-by: Santhosh Ram Manohar <santhosh@docker.com>
2015-08-07 14:58:41 -07:00
Madhu Venugopal 7659c25f08 Merge pull request #444 from aboch/dl
Fix in bridge delete endpoint
2015-08-07 05:43:31 -07:00
Alessandro Boch 0eb9387480 Fix in bridge delete endpoint
- In DeleteEndpoint(), veth removal is a best effort,
  as it could have alreayd been removed by sandbox destroy.
  Therefore if veth is not found, cleanup defer function
  should not run.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-06 17:04:38 -07:00
Alessandro Boch 351330bc19 Simplify NetworkOverlaps function
- Doing a lot of unnecessary things.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-06 10:14:35 -07:00
Madhu Venugopal 8280c188e2 Merge pull request #440 from aboch/dfe
Fix bug "...has already joined the endpoint"
2015-08-05 17:42:58 -07:00
Alessandro Boch 50d35c0a8a Fix bug "...has already joined the endpoint"
- In case of sandboxAdd() failure, drive.Leave() call
  in first executed defer reset err to nil. Secondly
  executed defer in charge of resetting ep.container to nil
  will not get executed.

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-05 17:13:46 -07:00
Madhu Venugopal 54a2ee8e58 Merge pull request #283 from mbanikazemi/iptables_setup
Separates the driver-specific and network-specific iptable operations
2015-08-05 09:41:54 -07:00