Commit Graph

682 Commits

Author SHA1 Message Date
Madhu Venugopal c932bc4cc5 Merge pull request #504 from tmakita/fix-service-detach
Fix inability to detach service
2015-09-09 02:24:20 -07:00
Toshiaki Makita a3d02dea09 Fix inability to detach service
CmdServiceDetach() incorrectly uses containerID where sandboxID is
expected. Thus, procDeleteSandbox() fails to find the corresponding
sandbox and returns the "Resource not found" error.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-09-09 10:10:11 +09:00
aboch 491e5f075a Merge pull request #501 from tmakita/fix-sandboxes-api
Add missing sandboxes routes
2015-09-08 07:22:33 -07:00
Toshiaki Makita f15b90662e Add missing sandboxes routes
Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-09-08 15:30:47 +09:00
Madhu Venugopal 3e31cead05 Merge pull request #500 from mrjana/bugs
Fix CI failure due to conflicting merges
2015-09-07 19:43:16 -07:00
Jana Radhakrishnan ac8fb2cf9f Fix CI failure due to conflicting merges
There were two pending PRs with package level
changes but no source level conflicts. This got
merged because git cannot detect this.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-07 19:35:39 -07:00
Jana Radhakrishnan ba8b3c862d Merge pull request #498 from WeiZhang555/bug
Fix bug for `docker service ls`
2015-09-07 19:21:38 -07:00
Zhang Wei 6c9aafa00b Fix bug for docker service ls
fix bug for `docker service ls` error:
"Failed to retrieve backend list for service xxx (json: cannot
unmarshal object into Go value of type []client.sandboxResource)"

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2015-09-08 09:37:35 +08:00
Madhu Venugopal 43c0a493d9 Merge pull request #494 from mrjana/bugs
Fix bridge driver panic in CreateNetwork
2015-09-07 13:17:48 -07:00
aboch a494f4864f Merge pull request #499 from calavera/move_test_files
Move test specific functions to a testutils package.
2015-09-07 11:36:05 -07:00
David Calavera 3afcd65d6e Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
Jana Radhakrishnan 24a2237e1d Fix libkv source out-of-sync with Godeps
Looks like the libkv version vendored in really not in
sync with the git hash value in Godeps.json. The commit
https://github.com/docker/libnetwork/commit/e2a63dff5a38a0f26f7f0c36356f3a6a28f4efeb
has just updated the Godeps.json without update the source.
Dnet in multi-host testing is broken due to this, while
docker mult-host functionality works because the correct
version of libkv has been vendored in docker/docker.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-05 20:56:13 -07:00
Jana Radhakrishnan af799cd8c5 Merge pull request #496 from docker/bug
Fix bitsequence set()
2015-09-05 10:57:12 -07:00
Alessandro Boch 71f57e33b9 Fix bitsequence set()
- incorrect handling during datastore write

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-09-04 18:15:54 -07:00
Jana Radhakrishnan 128ad3ca2d Fix bridge driver panic in CreateNetwork
Bridge driver panics in `CreateNetwork` if called without
a prior `Config` call. This causes issues in dnet which
tries to create network using default driver configuration.
It should be valid to call `CreateNetwork` without a prior
`Config` call in which case we need to assume default driver
config.

Fixed this by properly initializing the driver config pointer.
Also introduced a `configured` bool to make sure that still
`Config` is called exactly once for the instance of the bridge
driver.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-04 11:19:52 -07:00
Madhu Venugopal 7901696fec Merge pull request #491 from sanimej/ov-mtu
For the endpoints on overlay network set the MTU to 1450 to avoid fra…
2015-09-04 08:48:23 -07:00
aboch 622b9f3594 Merge pull request #493 from mrjana/bugs
Fix go fmt errors in the build
2015-09-03 16:52:09 -07:00
Jana Radhakrishnan fea45bdd7f Fix go fmt errors in the build
Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-09-03 16:47:30 -07:00
Jana Radhakrishnan dc74350acc Merge pull request #443 from aboch/mb
Fixes ip allocation for multi bridge networks
2015-09-03 16:30:19 -07:00
Jana Radhakrishnan e57da3f360 Merge pull request #490 from tmakita/test-err-msg
Add TestEndToEndErrorMessage
2015-09-03 09:53:26 -07:00
Toshiaki Makita 35acbc9f59 Add TestEndToEndErrorMessage
Test if error messages from daemon are not empty strings.

Confirmed it fails without 8aa9f4e.

 --- FAIL: TestEndToEndErrorMessage (0.03s)
 	api_test.go:2266: Empty response error message.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-09-03 13:36:08 +09:00
Madhu Venugopal dc52820147 Merge pull request #487 from aboch/tmakita
Don't discard error message on sending response
2015-09-02 16:22:28 -07:00
Toshiaki Makita 8aa9f4eee6 Don't discard error message on sending response
Error messages are always discarded and it makes diagnostic difficult
when error occurs.

Before:
$ dnet network create -d overlay ov1
error : ""
$ docker network create -d overlay ov1
Error response from daemon: ""

After:
$ dnet network create -d overlay ov1
error : "no datastore configured. cannot obtain vxlan id"
$ docker network create -d overlay ov1
Error response from daemon: "no datastore configured. cannot obtain vxlan id"

Breakage caused by  7b8bb3e

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
2015-09-02 16:15:14 -07:00
Santhosh Manohar f7395884ae For the endpoints on overlay network set the MTU to 1450 to avoid fragmentation when the vxlan header gets added
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-09-02 09:58:36 -07:00
Jana Radhakrishnan a125c33787 Merge pull request #483 from mavenugo/cp
Cherry-picking #482 to master
2015-09-02 09:10:50 -07:00
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
Alessandro Boch 13738d592e Fixes ip allocation for multi bridge networks
- Do not discard errors on ip allocation for gw and bridge
- Release addresses on network delete
- Add some context on top of ipallocator returned error
- Create ip allocator instance at driver creation, not at package init,
  otherwise this affects bridge test code where ip db is carried over
  test functions

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-08-27 20:39:30 -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