Commit Graph

1872 Commits

Author SHA1 Message Date
6154bc2582 Merge pull request #15181 from Microsoft/10662-registermountpoints
Windows: Tidy/godoc volume*.go
Upstream-commit: ef24b8e485df8f5f165e501a131695d33b5f67b3
Component: engine
2015-08-02 13:04:48 -04:00
52775fed20 Merge pull request #15226 from vdemeester/3745-remote-TEST-env-test-from-daemon
Remove daemon check for TEST
Upstream-commit: bf384a3e4f6cde9613d251f0058b4de96a0d2f33
Component: engine
2015-08-01 13:10:02 -04:00
53438e8738 Remove daemon check for TEST
Closes #3745

I think DEBUG is still used (might be wrong though) and according to
https://github.com/docker/docker/issues/3745#issuecomment-76035979 there
is now nothing in integration (all has been migrated to integration-cli)

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 9af6b57a5d466ab3fdea0db8ba8d9a417519a63e
Component: engine
2015-08-01 15:13:38 +02:00
23023fa5ed Ensure reader position is at the end after tailing
After tailing a file, if the number of lines requested is > the number
of lines in the file, this would cause a json unmarshalling error to
occur when we later try to go follow the file.
So brute force set it to the end if any tailing occurred.

There is potential that there could be some missing log messages if logs
are being written very quickly, however I was not able to make this
happen even with `while true; do echo hello; done`, so this is probably
acceptable.

While testing this I also found a panic in LogWatcher.Close can be
called twice due to a race. Fix channel close to only close when there
has been no signal to the channel.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c57faa91e2dab72a0a0905dc10e5cbdf55b545f5
Component: engine
2015-08-01 08:00:28 -04:00
03122f024f Merge pull request #15144 from aaronlehmann/graph-cleanup
Documentation improvements and code cleanups for graph package
Upstream-commit: 8f2dca538619372663a94bc5141dbc7f121defb8
Component: engine
2015-07-31 15:11:34 -07:00
804da3f9c2 Tidy volume*.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 72c04ab87ce16ab592e66da1753c0dc6cdc89517
Component: engine
2015-07-31 13:13:40 -07:00
0514f6080b Merge pull request #15179 from Microsoft/10662-yetmoretodos
Windows: Tidy verifyContainerSettings
Upstream-commit: 500a314713b9c2382c77d1d57cab960ce94f3661
Component: engine
2015-07-30 23:58:16 -04:00
385c38be8c Merge pull request #15146 from kolyshkin/mkdirall
Simplify and fix MkdirAll usage
Upstream-commit: 8d2739df980a1af76ad50e5c423134815186b61c
Component: engine
2015-07-30 22:40:57 -04:00
69fe9b7219 Merge pull request #15186 from brahmaroutu/btrfs_test_failure
fix unit test breakage due to lint changes
Upstream-commit: 0b089bc7d5bc8c70bb18c45bb4b6615038d7f7cf
Component: engine
2015-07-30 22:39:40 -04:00
bdce5e6b99 fix unit test breakage due to lint changes
Addresses #14756

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 22873eae3153f93b55b3b09eff887a3bfdc8eb54
Component: engine
2015-07-31 00:22:28 +00:00
9b3fa793ce Merge pull request #15174 from Microsoft/10662-top
Windows: Top (non-)implementation
Upstream-commit: 044b56e94fcb1def77efda36a2cf60f97e82e866
Component: engine
2015-07-30 19:49:15 -04:00
6c86a6f59d Windows: Address more todos
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3fea79bfd835960e3f6c9972305e350ee2e256b2
Component: engine
2015-07-30 15:28:11 -07:00
15e0190adc Merge pull request #15176 from Microsoft/10662-removesometodos
Windows: Remove some TODOs
Upstream-commit: c1e2e4d9c69649e502a6099144763a75f5ea6212
Component: engine
2015-07-30 15:26:06 -07:00
c1a15a2b27 Merge pull request #14922 from rhatdan/netlabel
Label /etc/resolv.conf, /etc/hosts ... correctly in shared network co…
Upstream-commit: 86a6e4914f761188dd4495810d7901ced778f438
Component: engine
2015-07-30 15:03:49 -07:00
3da5dccbd9 Windows: Remove some TODOs
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f50b916ca6cce410f3b1bbd5250fb9ba2a7942a6
Component: engine
2015-07-30 14:46:51 -07:00
c5a5900eb9 Documentation improvements and code cleanups for graph package
Expand the godoc documentation for the graph package.

Centralize DefaultTag in the graphs/tag package instead of defining it
twice.

Remove some unnecessary "config" structs that are only used to pass
a few parameters to a function.

Simplify the GetParentsSize function - there's no reason for it to take
an accumulator argument.

Unexport some functions that aren't needed outside the package.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: d4836cd7ec1c085c5a5caa7eb7f5eda4ace10eb6
Component: engine
2015-07-30 14:27:10 -07:00
7209ad66b6 Windows: Top (non-)implementation
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 0a9ec21818151304654085fd86a4b2ed54925e9a
Component: engine
2015-07-30 14:25:15 -07:00
05325c6d3a Merge pull request #15170 from runcom/i-like-cleaning
Remove HostConfig,SetHostConfig from daemon.container
Upstream-commit: 41d9270a40469a3226261285525c6696fd996bed
Component: engine
2015-07-30 17:23:58 -04:00
a55bf4a409 Merge pull request #14885 from jlhawn/fix_cp_symlink
Fix copying of symlinks in containers
Upstream-commit: 030f61df3db2c053d68aacddc2c6893db3dee6ce
Component: engine
2015-07-30 13:42:40 -07:00
12be4fa37a Remove HostConfig,SetHostConfig from daemon.container
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: f95333010e1c036ac33d75f5271af1f2b03a276e
Component: engine
2015-07-30 22:25:31 +02:00
f32fe35a14 Merge pull request #15148 from hqhq/hq_golint_native
Add back golint for daemon/execdriver/native
Upstream-commit: 2d730c93b4010b314f5365b22810823201ea1d58
Component: engine
2015-07-30 15:51:06 -04:00
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
76f950f781 Merge pull request #15163 from crosbymichael/proc-ro
Don't mount /proc as ro
Upstream-commit: a687448c4dec200336ed28c5ef26c8198cc0505b
Component: engine
2015-07-30 15:12:29 -04:00
3c8e934faf Simplify and fix os.MkdirAll() usage
TL;DR: check for IsExist(err) after a failed MkdirAll() is both
redundant and wrong -- so two reasons to remove it.

Quoting MkdirAll documentation:

> MkdirAll creates a directory named path, along with any necessary
> parents, and returns nil, or else returns an error. If path
> is already a directory, MkdirAll does nothing and returns nil.

This means two things:

1. If a directory to be created already exists, no error is returned.

2. If the error returned is IsExist (EEXIST), it means there exists
a non-directory with the same name as MkdirAll need to use for
directory. Example: we want to MkdirAll("a/b"), but file "a"
(or "a/b") already exists, so MkdirAll fails.

The above is a theory, based on quoted documentation and my UNIX
knowledge.

3. In practice, though, current MkdirAll implementation [1] returns
ENOTDIR in most of cases described in #2, with the exception when
there is a race between MkdirAll and someone else creating the
last component of MkdirAll argument as a file. In this very case
MkdirAll() will indeed return EEXIST.

Because of #1, IsExist check after MkdirAll is not needed.

Because of #2 and #3, ignoring IsExist error is just plain wrong,
as directory we require is not created. It's cleaner to report
the error now.

Note this error is all over the tree, I guess due to copy-paste,
or trying to follow the same usage pattern as for Mkdir(),
or some not quite correct examples on the Internet.

[v2: a separate aufs commit is merged into this one]

[1] https://github.com/golang/go/blob/f9ed2f75/src/os/path.go

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
Upstream-commit: a83a76934787a20e96389d33bd56a09369f9b808
Component: engine
2015-07-30 11:48:08 -07:00
114011a355 Only explicitly deny ptrace for container-originated procs
The 'deny ptrace' statement was supposed to only ignore
ptrace failures in the AUDIT log. However, ptrace was implicitly
allowed from unconfined processes (such as the docker daemon and
its integration tests) due to the abstractions/base include.

This rule narrows the definition such that it will only ignore
the failures originating inside of the container and will not
cause denials when the daemon or its tests ptrace inside processes.

Introduces positive and negative tests for ptrace /w apparmor.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: f5c388b35a9ddd699b3dbbe85b80fa02234f8355
Component: engine
2015-07-30 14:40:28 -04:00
8461105dc9 Don't mount /proc as ro
This caused a regression with LSM labeling.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: bfc51cf6605ebcf7a4ec791fb0f3b5ae7b05c6fd
Component: engine
2015-07-30 10:57:50 -07:00
639fd1d44b Add back golint for daemon/execdriver/native
It's broken by #15099 Fix it.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: e34f562a77276516b81756e9ea620a1625c49093
Component: engine
2015-07-30 08:58:54 +08:00
8521089b9c Merge pull request #14773 from runcom/cleanup-links
Cleanup links top level pkg
Upstream-commit: 6adb64e1130f32fa6da9c1f95faaffbb9940c079
Component: engine
2015-07-29 20:17:44 -04:00
197e6f60b8 Merge pull request #15040 from vbatts/vbatts-double-decompress-fix
archive, graphdriver: double decompress fix
Upstream-commit: 8724e8953d446ade61856d4944126ffccb2aead9
Component: engine
2015-07-29 16:48:02 -07:00
1bd0671e56 Merge pull request #15098 from calavera/backwards_compat_kill_error
Keep backwards compatibility in kill api.
Upstream-commit: 4a71323ec3c00be48e3539a1da0444972f22c355
Component: engine
2015-07-29 16:42:36 -07:00
24b9b89f5c Merge pull request #15134 from calavera/swappiness_big_int
Use pointer for MemorySwappiness.
Upstream-commit: de500820000295cc339cdd843096c27bc47ccc96
Component: engine
2015-07-29 16:31:15 -07:00
c5fec26f40 Merge pull request #15138 from ewindisch/apparmor-fix-test-plus-unconfined
Fix the proc integration test & include missing AA profile
Upstream-commit: 2ae174e491a366c4663b4f6ecee83cd6f64bcc3f
Component: engine
2015-07-29 15:32:13 -07:00
4cd45101c0 Merge pull request #13542 from kvasdopil/freebsd-work
Make docker build on FreeBSD
Upstream-commit: 75f8bdd970e5355a6238e7b41a9f1aee9cd3f890
Component: engine
2015-07-29 15:15:37 -07:00
22c6edd13b Merge pull request #14843 from MHBauer/demonlogger-lint
golint fixes for daemon/logger/*
Upstream-commit: 6a274e48dc645f0ea02ae8bf59ce08ff22cfd663
Component: engine
2015-07-29 18:09:46 -04:00
ddcb599dbb Cleanup links top level pkg
- Move top level pkg links under daemon
- Refactor code accordingly
- golint pkg

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 0e0c7e521c996bc18a9e602122135b07d4d4469e
Component: engine
2015-07-29 23:39:18 +02:00
10b5ce2263 Use *int64 for MemorySwappiness.
So we marshal/unmarshal its value properly when it's empty.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 4e25d2982b3af25bf55b8bc788d4604f7b539ea4
Component: engine
2015-07-29 14:14:04 -07:00
36993f8dbd Fix the proc integration test & include missing AA profile
Integration tests were failing due to proc filter behavior
changes with new apparmor policies.

Also include the missing docker-unconfined policy resolving
potential startup errors. This policy is complain-only so
it should behave identically to the standard unconfined policy,
but will not apply system path-based policies within containers.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: 5832715052e9e165cc40a5ac8178fa62685985aa
Component: engine
2015-07-29 17:08:51 -04:00
e1b2148585 /graph fix lin errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 1d6e44311916b26e1cd128e96ea9f0e5ede5f9df
Component: engine
2015-07-29 20:59:36 +00:00
90287c6171 golint fixes for daemon/logger/*
- downcase and privatize exported variables that were unused
 - make accurate an error message
 - added package comments
 - remove unused var ReadLogsNotSupported
 - enable linter
 - some spelling corrections

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: ccbe539e86dfbb8749c09763ddfd73bf10ac57cc
Component: engine
2015-07-29 13:09:39 -07:00
4126b923f8 Merge pull request #15076 from hqhq/hq_merge_daemon_test
Merge daemon_unit_test.go to daemon_test.go
Upstream-commit: 0bab97fcba8d2b4be1650fef381926e6b0259cc5
Component: engine
2015-07-29 14:53:34 -04:00
abf825af14 Merge pull request #15111 from Microsoft/fix-archive-copy-log
Fix log to logrus
Upstream-commit: c09c497c71e3fbcec6fee6ee0f4eb5097fc1b4b7
Component: engine
2015-07-29 14:48:19 -04:00
59df5a01ec make docker compile on freebsd
Signed-off-by: Alexey Guskov <lexag@mail.ru>
Upstream-commit: 26c03d561ab126287bb3034cc23477d18869a888
Component: engine
2015-07-29 21:25:56 +03:00
a14f132348 Merge pull request #15128 from ankushagarwal/logging
Doc fixes in daemon/logger, update NewCopier method
Upstream-commit: 0a2ec227f89d602f73867cae14bab0294d32fe20
Component: engine
2015-07-29 14:20:34 -04:00
307e5a8a1e Merge pull request #14930 from brahmaroutu/lint_daemon_graphdriver_devmapper
daemon/graphdriver/devmapper/ fix lint errors/warnings
Upstream-commit: dfcdde4d9832adb5bbee146cdf5fac2cc5926b4f
Component: engine
2015-07-29 13:29:57 -04:00
9da89dbbd1 Doc fixes in logger, update NewCopier method
Signed-off-by: Ankush Agarwal <ankushagarwal11@gmail.com>
Upstream-commit: 41d85c014defd96cda06abac73554d9f9d1de0d8
Component: engine
2015-07-29 10:05:46 -07:00
a7dc60d0d3 Fix log to logrus
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 2bf73c4b1a3b195ee426e74d221a9df032aaa89e
Component: engine
2015-07-29 09:58:07 -07:00
eb4cbd9958 Labels on network content need to be shared if shared network namespace
If I run two containers with the same network they share the same /etc/resolv.conf.
The current code changes the labels of the /etc/resolv.conf currently to the
private label which causes it to be unusable in the first container.

This patch changes the labels to a shared label if more then one container
will use the content.

Docker-DCO-1.1-Signed-off-by: Dan Walsh dwalsh@redhat.com (github: rhatdan)

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 90b8cebda65b9e45c75c44010833e181167dd4f6
Component: engine
2015-07-29 12:42:28 -04:00
7b7157591c Merge pull request #15099 from ewindisch/apparmor-restore-en
Restore AppArmor generation + fixes
Upstream-commit: d7661cb48b93978b4b30d2c60f3201d685af7f95
Component: engine
2015-07-29 09:36:59 -07:00
67bf5ba305 Replace GenerateRandomID with GenerateNonCryptoID
This allow us to avoid entropy usage in non-crypto critical places.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6bca8ec3c9ccc169c53b3d7060fe5c8ba8670aac
Component: engine
2015-07-28 22:31:01 -07:00
581a7026d5 daemon/graphdriver/devmapper/ fix lint errors/warnings
Addresses #14756
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 972a94b449ea6a68f041c47fe7bda35b5ac765a2
Component: engine
2015-07-29 01:43:34 +00:00