Louis Opter
fac0d87d00
Add support for UDP ( closes #33 )
...
API Changes
-----------
The port notation is extended to support "/udp" or "/tcp" at the *end*
of the specifier string (and defaults to tcp if "/tcp" or "/udp" are
missing)
`docker ps` now shows UDP ports as "frontend->backend/udp". Nothing
changes for TCP ports.
`docker inspect` now displays two sub-dictionaries: "Tcp" and "Udp",
under "PortMapping" in "NetworkSettings".
Theses changes stand true for the values returned by the HTTP API too.
This changeset will definitely break tools built upon the API (or upon
`docker inspect`). A less intrusive way to add UDP ports in `docker
inspect` would be to simply add "/udp" for UDP ports but it will still
break existing applications which tries to convert the whole field to an
integer. I believe that having two TCP/UDP sub-dictionaries is better
because it makes the whole thing more clear and more easy to parse right
away (i.e: you don't have to check the format of the string, split it
and convert the right part to an integer)
Code Changes
------------
Significant changes in network.go:
- A second PortAllocator is instantiated for the UDP range;
- PortMapper maintains separate mapping for TCP and UDP;
- The extPorts array in NetworkInterface is now an array of Nat objects
(so we can know on which protocol a given port was mapped when
NetworkInterface.Release() is called);
- TCP proxying on localhost has been moved away in network_proxy.go.
localhost proxy code rewrite in network_proxy.go:
We have to proxy the traffic between localhost:frontend-port and
container:backend-port because Netfilter doesn't work properly on the
loopback interface and DNAT iptable rules aren't applied there.
- Goroutines in the TCP proxying code are now explicitly stopped when
the proxy is stopped;
- UDP connection tracking using a map (more infos in [1]);
- Support for IPv6 (to be more accurate, the code is transparent to the
Go net package, so you can use, tcp/tcp4/tcp6/udp/udp4/udp6);
- Single Proxy interface for both UDP and TCP proxying;
- Full test suite.
[1] https://github.com/dotcloud/docker/issues/33#issuecomment-20010400
2013-07-09 17:42:35 -07:00
Louis Opter
1a1daca621
Fix a typo in runtime_test.go: Availalble -> Available
2013-07-09 11:52:33 -07:00
Guillaume J. Charmes
e43ef364cb
Remove all network dependencies from the test suite
2013-07-08 15:23:04 -07:00
Sam Alba
e2b8ee2723
Fixed runtime_test (ImagePull prototyped changed)
2013-07-05 16:03:22 -07:00
Caleb Spare
ba9aef6f2c
Typo fix
...
Error message grammar tweak
2013-07-04 12:40:14 -07:00
Caleb Spare
19121c16d9
Implement several golint suggestions, including:
...
* Removing type declarations where they're inferred
* Changing Url -> URL, Id -> ID in names
* Fixing snake-case names
2013-07-03 14:36:04 -07:00
Caleb Spare
1cf9c80e97
Mutex style change.
...
For structs protected by a single mutex, embed the mutex for more
concise usage.
Also use a sync.Mutex directly, rather than a pointer, to avoid the
need for initialization (because a Mutex's zero-value is valid and
ready to be used).
2013-07-02 15:53:08 -07:00
Victor Vieux
ebba0a6024
add sleep in tests and go fmt
2013-07-02 10:47:37 +00:00
Guillaume J. Charmes
b6f288a1ce
Fix unit tests when there is more than one tag within the test image
2013-07-01 11:45:45 -07:00
Solomon Hykes
b7226316c7
* Hack: move unit tests to a different source image, to work around issues when docker-ut has more than 1 tag.
2013-06-28 19:43:55 -07:00
Louis Opter
fe014a8e6c
Always return the correct test image.
...
And not a *random* one from its history.
2013-06-27 18:01:20 -07:00
Gabriel Monroy
4fdf11b2e6
+ Runtime: mount volumes from a host directory with 'docker run -b'
2013-06-26 15:07:31 -07:00
Guillaume J. Charmes
5190f7f33a
Implement regression test for stdin attach
2013-06-24 18:36:04 -07:00
Guillaume J. Charmes
873a5aa8e7
Make NewDockerCli handle terminal
2013-06-24 18:29:08 -07:00
Guillaume J. Charmes
a749fb2130
Make DockerCli use its own stdin/out/err instead of the os.Std*
2013-06-24 18:27:57 -07:00
Solomon Hykes
ce9e50f4ee
Remove dependency on 'os/user', which cannot be used with CGO_ENABLED=0. This allows running the tests without CGO.
2013-06-21 19:40:42 -07:00
Guillaume J. Charmes
fe204e6f48
- Runtime: Forbid parralel push/pull for a single image/repo. Fixes #311
2013-06-17 16:10:00 -07:00
Victor Vieux
c46382ba29
rebase master
2013-06-13 17:58:06 +00:00
Victor Vieux
9cdd39e0d7
Merge branch 'master' into 691-run_id-feature
2013-06-13 13:18:43 +00:00
Victor Vieux
45a8945746
added test
2013-06-13 13:17:56 +00:00
Victor Vieux
c906239220
bump to master
2013-06-05 10:23:45 +00:00
Victor Vieux
fd224ee590
linted names
2013-06-04 18:00:22 +00:00
Victor Vieux
62c78696cd
bump to master
2013-06-03 11:06:13 +00:00
Guillaume J. Charmes
9bc71c101c
Merge pull request #719 from dotcloud/json_stream-feature
...
* API: push, pull, import, insert -> Json Stream
2013-05-31 16:05:15 -07:00
Victor Vieux
cd002a4d16
ensure progress downloader is well formated
2013-05-30 17:00:42 +00:00
Victor Vieux
49e656839f
move auth to the client WIP
2013-05-30 15:39:43 +00:00
Victor Vieux
2a53717e8f
if address already in use in unit tests, try a different port
2013-05-30 13:45:39 +00:00
Guillaume J. Charmes
08e5f12954
Merge pull request #739 from dotcloud/push_issue-1
...
- Registry: Cereate a new registry object for each request (~session)
2013-05-29 09:22:12 -07:00
Victor Vieux
f339fc2eb9
bump to master
2013-05-29 13:52:18 +00:00
Guillaume J. Charmes
b76d6120ac
Update tests with new cookies for registry
2013-05-28 17:35:10 -07:00
Guillaume J. Charmes
5b33b2463a
Readd build tests
2013-05-28 15:31:06 -07:00
Guillaume J. Charmes
dce82bc856
Merge master
2013-05-28 13:42:50 -07:00
Guillaume J. Charmes
6ae3800151
Implement the CmdAdd instruction
2013-05-28 13:38:26 -07:00
Victor Vieux
c8c7094b2e
imporved error, push, import insert
2013-05-25 15:09:46 +00:00
Solomon Hykes
bb4b35a892
Fix a unit test broken by pull request #703
2013-05-24 18:32:21 -07:00
Guillaume J. Charmes
10e19e4b97
Update tests to reflect new AuthConfig
2013-05-15 17:31:11 -07:00
Guillaume J. Charmes
e7077320ff
Update tests to reflect new project structure
2013-05-15 01:52:09 +00:00
Victor Vieux
32cbd72ebe
Merge branch 'master' into remote-api
2013-05-07 21:02:32 +02:00
Victor Vieux
59a6316f5e
added search
2013-05-07 20:43:31 +02:00
Guillaume J. Charmes
42b1ea4889
Check the command existance prior create and add Unit tests for the case
2013-05-07 11:18:13 -07:00
Victor Vieux
10c0e99037
update to master
2013-05-07 19:23:50 +02:00
Guillaume J. Charmes
ff95f2b0ec
Update the unit tests to reflect the new API
2013-05-06 16:00:30 -07:00
Victor Vieux
04cd20fa62
split api and server. run return exit code. import, pull and commit uses the smae endpoint. non zero status code on failure
2013-05-06 11:31:22 +02:00
Guillaume J. Charmes
9042535f5a
Move the capabilities detection into a runtime method
2013-04-26 14:32:55 -07:00
Guillaume J. Charmes
8f81e175af
Merge pull request #473 from dotcloud/26-auto_restart_containers-feature
...
+ runtime: Add -r flag to dockerd in order to restart previously running container....
2013-04-26 14:02:01 -07:00
Guillaume J. Charmes
636c7835d3
Merge pull request #467 from dotcloud/improve_localhost_port_test
...
* tests: Improve unit test to avoid unnecessary warnigns
2013-04-26 14:01:13 -07:00
Guillaume J. Charmes
50144aeb42
Add -r flag to dockerd in order to restart previously running container. Fixes #26
2013-04-24 19:01:23 -07:00
Guillaume J. Charmes
ee298d1420
Specify a different bridge for tests than for regular runtime
2013-04-24 17:43:41 -07:00
Guillaume J. Charmes
5a02c9ba0a
Make sure the container is well started prior to perform the test
2013-04-23 11:08:31 -07:00
Solomon Hykes
73da7a12e7
Increased timeout in TCP port allocation test to pass on slower machines
2013-04-23 10:12:46 -07:00
Solomon Hykes
76b40ad6c9
Merge remote-tracking branch 'origin/check_kernel_capabilities'
2013-04-20 17:40:25 -07:00
Solomon Hykes
911925b54a
Add a test for allocating tcp ports and reaching them on localhost
2013-04-19 20:46:07 -07:00
Guillaume J. Charmes
f68d107a13
Remove the NO_MEMORY_LIMIT constant
2013-04-18 21:08:20 -07:00
Solomon Hykes
ca6cd5b557
Keep a cache of the unit-tests image. So I can code in conferences with crappy wifi.
2013-04-17 11:32:13 -07:00
Guillaume J. Charmes
1967c8342a
Allow to disable memory limit at compilation time
2013-04-12 10:48:20 -07:00
Guillaume J. Charmes
bb22cd492e
Add unit test for hanging kill + fix other tests behaviour
2013-04-11 16:21:19 -07:00
Solomon Hykes
a7299a3f26
Merge remote-tracking branch 'origin/unit_test_improvment-2'
2013-04-08 18:29:12 -07:00
Guillaume J. Charmes
80f6b4587b
Edit the tests for them to use the new command API. Disable TestRunHostname and TestAttachStdin.
2013-04-08 15:58:09 -07:00
Guillaume J. Charmes
b76b329ef0
Prevent destroy() to stop twice container in TestRestore()
2013-04-04 20:40:42 -07:00
Guillaume J. Charmes
bae6f95830
Increase the timeout of TestRestore() to avoid unwanted timeout error
2013-04-04 20:32:44 -07:00
Solomon Hykes
586a79cca0
Merge remote-tracking branch 'dominikh/minor-code-touchups'
2013-04-04 16:20:37 -07:00
Solomon Hykes
6b5fe8c2ec
Merge remote-tracking branch 'origin/257-container_real_running_state-fix'
2013-04-04 15:34:18 -07:00
shin-
ad0183e419
Check WaitTimeout return in test, replaced lock initialization in runtime.Register() with call to initLock()
2013-04-03 10:48:02 -07:00
shin-
7b74b9cab5
Integrated @creack's feedback on TestRestore
2013-04-03 05:37:45 -07:00
Dominik Honnef
14d3880daf
remove superfluous panic
2013-04-03 11:19:48 +02:00
Dominik Honnef
cab31fd512
use wg.Done() isntead of wg.Add(-1)
2013-04-03 11:11:34 +02:00
Dominik Honnef
1fc55c2bb9
kill the right containers in runtime_test
2013-04-03 11:11:06 +02:00
Solomon Hykes
8f9e454241
[unit tests] Cleanly kill all containers before nuking a temporary runtime
2013-04-02 11:00:14 -07:00
shin-
791ca6fde4
Better crash simulation in TestRestore ; force state lock creation when loading a container from disk
2013-04-02 10:06:49 -07:00
shin-
02c211a0dc
variable names
2013-04-02 07:13:42 -07:00
shin-
c780ff5ae7
More thorough test case, use container.Stop() instead of lxc-kill,
...
use setStopped() during the restore step
2013-04-02 07:01:43 -07:00
Guillaume J. Charmes
8c36e6920a
Working in progress: add unit tests for the running state check
2013-03-31 20:14:54 -07:00
Solomon Hykes
d01b5894c4
Unit tests fetch their base image with 'docker pull docker-ut'
2013-03-25 17:18:56 -07:00
Solomon Hykes
6ce64e8458
Moved image name into config. runtime.Create() now receives a single Config parameter
2013-03-23 12:39:09 -07:00
Solomon Hykes
031f91df1a
runtime.Create receives an image name + Config. The Config includes all required runtime information: command, environment, ports etc.
2013-03-23 12:16:58 -07:00
Solomon Hykes
ef711962d5
Folded graph/ back into main package
2013-03-21 17:47:23 -07:00
Solomon Hykes
44faa07b6c
First integration of runtime with repositories & tags
2013-03-21 17:35:49 -07:00
Solomon Hykes
377cebe36f
Renamed docker*.go to runtime*.go
2013-03-21 01:24:54 -07:00