Commit Graph

96 Commits

Author SHA1 Message Date
0a7e55f30a Fix docker cp Behavior With Symlinks
[pkg/archive] Update archive/copy path handling

  - Remove unused TarOptions.Name field.
  - Add new TarOptions.RebaseNames field.
  - Update some of the logic around path dir/base splitting.
  - Update some of the logic behind archive entry name rebasing.

[api/types] Add LinkTarget field to PathStat

[daemon] Fix stat, archive, extract of symlinks

  These operations *should* resolve symlinks that are in the path but if the
  resource itself is a symlink then it *should not* be resolved. This patch
  puts this logic into a common function `resolvePath` which resolves symlinks
  of the path's dir in scope of the container rootfs but does not resolve the
  final element of the path. Now archive, extract, and stat operations will
  return symlinks if the path is indeed a symlink.

[api/client] Update cp path hanling

[docs/reference/api] Update description of stat

  Add the linkTarget field to the header of the archive endpoint.
  Remove path field.

[integration-cli] Fix/Add cp symlink test cases

  Copying a symlink should do just that: copy the symlink NOT
  copy the target of the symlink. Also, the resulting file from
  the copy should have the name of the symlink NOT the name of
  the target file.

  Copying to a symlink should copy to the symlink target and not
  modify the symlink itself.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 75f6929b449a59335572436862d644afacf55cdb
Component: engine
2015-07-30 12:14:28 -07:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
dec1a0e3c4 Check for nil before using HostConfig to adjustCpuShares
Fix #14915. Add unit test for #14915.
Thanks @runcom for the test case: when the client calls 1.18 api
version w/o hostconfig it results in a nil pointer dereference.

Signed-off-by: Stephen Rust <srust@blockbridge.com>
Upstream-commit: c358a4cd3597ac330674c9d93b6038e8f455c8f7
Component: engine
2015-07-26 20:33:04 -04:00
6fd5a9b231 Ensure body is closed after error is checked
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 18faf6f94e0995ac3fab703d22ca82baf4a65676
Component: engine
2015-07-23 14:34:38 +02:00
6aa4de764e Fix golint warnings for integration-cli
Signed-off-by: Ben Firshman <ben@firshman.co.uk>
Upstream-commit: 6b3c928140193f911b73f87bb8b07f54bba5a63a
Component: engine
2015-07-22 14:03:50 +01:00
2d8d0361a7 Merge pull request #13711 from calavera/version_volumes_inspect
Expose new mount points structs in inspect.
Upstream-commit: 50d2597e490c4636ee8cacabf34bb9ed3e21d3fc
Component: engine
2015-07-22 09:02:00 +02:00
9c4a1f92a0 Merge pull request #14804 from dave-tucker/golint_nat
golint: Fix issues in pkg/nat
Upstream-commit: ff011ededba4b51c047a9f8d27c7c5c327494c0d
Component: engine
2015-07-21 20:38:40 -07:00
8365f62c47 Merge pull request #14822 from runcom/host-config-links-on-start
Allow starting a container with an existing hostConfig which contains links
Upstream-commit: 06162fed8b12d4f43ca3d03d6956996b6c73015d
Component: engine
2015-07-21 20:06:26 -07:00
89ab877e9d golint: Fix issues in pkg/nat
Updates #14756

Signed-off-by: Dave Tucker <dt@docker.com>
Upstream-commit: 15d01d6e6c57f4b8a39dddd2676a2d6914c62c77
Component: engine
2015-07-22 00:47:41 +01:00
b821d19c27 Expose new mount points structs in inspect.
Keep old hashes around for old api version calls.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 1c3cb2d31ea722e2c174bf78eda62fec6949fb8b
Component: engine
2015-07-21 15:33:05 -07:00
acbea7273b Allow starting a container with an existing hostConfig which contains links
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 65121e5fce3851d7d1e8c8cd5d77dd3c9591d773
Component: engine
2015-07-21 22:10:00 +02:00
a9efb7a3af Remove panic in nat package on invalid hostport
Closes #14621

This one grew to be much more than I expected so here's the story... :-)
- when a bad port string (e.g. xxx80) is passed into container.create()
  via the API it wasn't being checked until we tried to start the container.
- While starting the container we trid to parse 'xxx80' in nat.Int()
  and would panic on the strconv.ParseUint().  We should (almost) never panic.
- In trying to remove the panic I decided to make it so that we, instead,
  checked the string during the NewPort() constructor.  This means that
  I had to change all casts from 'string' to 'Port' to use NewPort() instead.
  Which is a good thing anyway, people shouldn't assume they know the
  internal format of types like that, in general.
- This meant I had to go and add error checks on all calls to NewPort().
  To avoid changing the testcases too much I create newPortNoError() **JUST**
  for the testcase uses where we know the port string is ok.
- After all of that I then went back and added a check during container.create()
  to check the port string so we'll report the error as soon as we get the
  data.
- If, somehow, the bad string does get into the metadata we will generate
  an error during container.start() but I can't test for that because
  the container.create() catches it now.  But I did add a testcase for that.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 12b6083c8f82db7e5db4c683cfe20151731ea851
Component: engine
2015-07-17 13:02:54 -07:00
abe73960d5 Use dockerCmd when possible (#14603)
- integration-cli/docker_cli_attach_test.go
- integration-cli/docker_cli_attach_unix_test.go
- integration-cli/docker_cli_build_test.go
- integration-cli/docker_cli_build_unix_test.go
- integration-cli/docker_cli_by_digest_test.go
- integration-cli/docker_cli_commit_test.go
- integration-cli/docker_cli_config_test.go
- integration-cli/docker_cli_cp_test.go
- integration-cli/docker_cli_create_test.go
- integration-cli/docker_cli_pause_test.go
- integration-cli/docker_cli_port_test.go
- integration-cli/docker_cli_port_unix_test.go
- integration-cli/docker_cli_proxy_test.go
- integration-cli/docker_cli_ps_test.go
- integration-cli/docker_cli_pull_test.go
- integration-cli/docker_cli_push_test.go

- docker_api_attach_test.go
- docker_api_containers_test.go
- docker_api_events_test.go
- docker_api_exec_resize_test.go
- docker_api_exec_test.go
- docker_api_images_test.go
- docker_api_info_test.go

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 5c295460da2098d971eda28a73b416ff6be62f53
Component: engine
2015-07-14 21:52:43 +02:00
cc86945735 Improve sockRequest and sockRequestRaw check
Signed-off-by: Quentin Tayssier <qtayssier@gmail.com>
Upstream-commit: fa6925aa9b3aad37e93bc38602bb665b4a2badf9
Component: engine
2015-07-13 21:49:08 +09:00
4d0125faee Fix regression in parsing capabilities list when a single string is given
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 10a3061c5f342477703e96d9b8b2e877d9cdddf5
Component: engine
2015-07-01 21:28:02 +02:00
748772ece4 Validate Port specifications on daemon side
Fixes #14230

Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 477201a2954349bfe7ab63f73b11cd19d0f782d0
Component: engine
2015-06-30 12:14:49 -07:00
213128a629 Fix unmarshalling of Command and Entrypoint
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 17d6f00ec2b8b9636f0bb64c55a5b3855e8f4bae
Component: engine
2015-06-26 09:00:57 -07:00
265055473c Support downloading remote tarball contexts in builder jobs.
Signed-off-by: Moysés Borges <moysesb@gmail.com>
Upstream-commit: d48bface59ef28aedc692c1f7c51a7ddde94a7fe
Component: engine
2015-06-19 16:35:00 -03:00
4c8d2626b0 register libnetwork API and UI with docker parent chain
This commit also brings in the ability to specify a default network and its
corresponding driver as daemon flags. This helps in existing clients to
make use of newer networking features provided by libnetwork.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Upstream-commit: da5a3e6dee80f1f5d4059851e4762ffb0484f7e9
Component: engine
2015-06-18 12:07:58 -07:00
f2616f1d40 Replace "sleep" by "top" in test implementation
Eliminate any chance of race condition by replacing a call to sleep by a
call to top, and rely on test cleanup logic to have it exit cleanly.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: e5b7f61f090bfc951590dd5dad3f6bb1ce3888ba
Component: engine
2015-06-12 10:45:42 -07:00
1bda4f96e2 Set omitempty for IP and PublicPort to conform w/ API 1.18
Signed-off-by: Darren Shepherd <darren@rancher.com>
Upstream-commit: 09de92b891c15bda593cf47617f032d2b0b40605
Component: engine
2015-06-12 09:49:53 -07:00
6aab6b5654 Avoid nil pointer dereference while creating a container with an empty Config
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 4ce817796e639391f6bc3e338f5a88985daacaca
Component: engine
2015-06-06 20:07:32 +02:00
e28afd6060 SizeRW & SizeRootFs omitted if empty in /container/json call
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 6945ac2d02adbe2931c9e8756ecbb7496b43081a
Component: engine
2015-06-03 23:13:56 +02:00
90d04ee342 Do not omit empty json field in /containers/json api response
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 725f34151c5f86b0b50f6e5601223e6da194af1b
Component: engine
2015-06-03 18:53:40 +02:00
77c76a3170 Update api documentation to add labels in commit
It is already possible to set labels at commit when using the API. But
it is not present in the API documentation. Added an integration test
too, to validate this work (and will be in the future).

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: c61fa8471a567b4890e0861f8aaff91a68c42e4f
Component: engine
2015-05-30 11:31:51 +02:00
4f53f1bb13 Merge pull request #13425 from runcom/13421-stats-default-stream
Fix regression in stats API endpoint
Upstream-commit: 4389fc8bf975a5df567c8431dda82d19a09733a3
Component: engine
2015-05-29 15:05:21 -07:00
2b62e414ad Fix regression in stats API endpoint where stream query param default is true
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: ec97f414657189f2ce95d6b5bda26aa9d206b705
Component: engine
2015-05-29 22:38:36 +02:00
6226136075 Remove PortSpecs from Config
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 15134a3320fbacee36e86a0342e7ffb49285f297
Component: engine
2015-05-29 22:38:09 +02:00
49dc08b2f2 Fix unregister stats on when rm running container
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: b3e8ab3021d2021202e14b912e7fdbfede4c7c20
Component: engine
2015-05-26 22:22:03 -04:00
89782c55eb Volumes refactor and external plugin implementation.
Signed by all authors:

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Signed-off-by: Jeff Lindsay <progrium@gmail.com>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Signed-off-by: Luke Marsden <luke@clusterhq.com>
Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 81fa9feb0cdc0773eff99d7393c16271e84aac08
Component: engine
2015-05-21 20:34:17 -07:00
56af424158 TestCase for CpuShares and Cpuset
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
Upstream-commit: ebe344d34b9d708b3634c2e17929cae1abb61ae8
Component: engine
2015-05-20 11:32:48 -07:00
7a2a7a58a0 Modified Test Case to include check for Memory and MemorySwap
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
Upstream-commit: 1eea2c589da4a4a3f5bfb83f6acf54af83ff4533
Component: engine
2015-05-13 13:39:07 -07:00
217a680718 Test Cases for API - Container create with Hostname, DomainName and NetworkMode
Signed-off-by: Rajdeep Dua <dua_rajdeep@yahoo.com>
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 80d73c838a279a3354713b56687e0c3f90c1efff
Component: engine
2015-05-07 21:03:39 +02:00
b9064ad316 Merge pull request #12822 from brahmaroutu/container_stop_api
restapi stop fails if ?t=int not present
Upstream-commit: d78755d15972fd1d3115d9927932f82bc09483df
Component: engine
2015-05-07 09:38:59 -07:00
e580063058 Restapi for stop fails if ?t=int not present
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 68e9c07850c95ded1e0a8adda39a8efe68e1c0ee
Component: engine
2015-05-07 15:43:50 +00:00
e90b34218e Do not check and return strconv.Atoi error in api container restart, regression
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 74121a42118750e560e772a3fee33e9d7bd903d0
Component: engine
2015-05-07 01:49:16 +02:00
61793a6050 Move ChunkedEncoding from integration
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 7c574b9e9d62f14c8d73ea358a557a771dcd8d4d
Component: engine
2015-05-06 13:00:17 -04:00
0f648e8ecd Add tests for API container delete
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 8771cafab65e50d09d3590a7f22758e919b78fe4
Component: engine
2015-05-04 22:41:57 +02:00
7bd38d02c2 Finally remove our copy of "archive/tar" now that Go 1.4 is the minimum!
IT'S ABOUT TIME. 🎉

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
Upstream-commit: 576985a1dcd76a9af2c5c483e6f12035a1f47b96
Component: engine
2015-05-01 16:01:10 -06:00
0ec0dcde9e Remove integration tests and port them to integration-cli
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: f7e417ea5e26f11ec43dba64ee153765d2276f40
Component: engine
2015-04-30 01:35:16 +02:00
6982f607b4 c.Fatal won't fail and exit test inside a goroutine, errors should be handled outside with a channel
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 4203230cbbf46238e38099c9073bdcad5f69a63f
Component: engine
2015-04-29 17:02:22 +02:00
f4e54f0df1 Merge pull request #12820 from runcom/yet-another-sockRequest-refactor
Expose whole Response struct in sockRequestRaw
Upstream-commit: cfa3a080c646878414585a8931416538a703a3e0
Component: engine
2015-04-28 13:26:30 -07:00
0b5b481a6d Merge pull request #12828 from tdmackey/trivial-spelling
trivial: typo cleanup
Upstream-commit: 0153edcda1527cd19f5952046b51c4e8358d01ed
Component: engine
2015-04-27 17:05:46 -04:00
ae74d9f34f trivial: typo cleanup
Signed-off-by: David Mackey <tdmackey@booleanhaiku.com>
Upstream-commit: 3941623fbc3fa724d61f53121513ffd87d03b61c
Component: engine
2015-04-27 13:35:08 -07:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
d1facd32fc Expose whole Response struct in sockRequestRaw
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: bb1c576eb3024f7fb4242d76dc835b7c4dd85c5b
Component: engine
2015-04-27 18:49:00 +02:00
13d6b715bf Merge pull request #12728 from HuKeping/addtest
Add test for REST API container rename
Upstream-commit: fefb8367663e5f97f8c85418691b10c6e9356134
Component: engine
2015-04-25 17:01:10 -07:00
478eada080 Fix race condition in API commit test
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: cd4f507b42e800d148b211ca2c780d01192a9041
Component: engine
2015-04-25 05:46:47 -07:00
e384b42fa8 Add test for REST API container rename
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 8f752ffeafd2f8c08035a5e39220fe17c9309fd7
Component: engine
2015-04-25 17:19:57 +08:00
c48fdf0abd Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a9688cdca5577d6db65d76f38bcbe4c1e6f5994f
Component: engine
2015-04-24 10:37:21 -07:00