Commit Graph

2116 Commits

Author SHA1 Message Date
1547f964d2 Merge pull request #16497 from MHBauer/attach-refactor-new
refactor attach to not use internal data structures
Upstream-commit: ddd0c47412dd30f1d333b5bd53e22c9949d1e86f
Component: engine
2015-09-23 16:52:39 -07:00
65ae094a39 refactor attach to not use internal data structures
- refactor to make it easier to split the api in the future

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 8aef1a33eb730a7c9b7e92b688bc63e6a3c69f62
Component: engine
2015-09-23 08:55:21 -07:00
d676c93895 Windows: [TP4] Add CPU Weight
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: a5879bb83b8e2855e23b5a1e282940362fc35dba
Component: engine
2015-09-22 18:29:15 -07:00
fca7da0a8e Merge pull request #16235 from HuKeping/oom-event
Events for OOM needs to be shift to an earlier time
Upstream-commit: 114612305c798735e7022274cc9db382f30aa174
Component: engine
2015-09-22 11:50:30 -07:00
a91e1506bf Merge pull request #16419 from HuKeping/comments
Comment: add description for some code which hard to understand
Upstream-commit: f97e6f2a374b85c5ef14b19b805991d98a7f3d27
Component: engine
2015-09-21 20:44:54 -07:00
fc5d97018d Comment: add description for some code which hard to understand
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 3b443abec254cb8214881e11af4c09e923cd2dd1
Component: engine
2015-09-22 09:34:49 +08:00
d787275160 Merge pull request #16466 from runcom/15876-fix-TestRunWithKernelMemory
daemon: execdriver: lxc: fix wrong template value passed to lxc conf
Upstream-commit: da82b5fedbc4763424e305d330cf7c31f896fed3
Component: engine
2015-09-21 16:34:34 -04:00
f1430df5ab Merge pull request #16404 from duglin/FixRenameError
Fix 'rename' error msg and error checking
Upstream-commit: 0c71c192395e259d76a51e08c7c3bd73eb6f16e7
Component: engine
2015-09-21 15:51:02 -04:00
fd7f03427f daemon: execdriver: lxc: fix wrong template value passed to lxc conf
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 7b4f73ee6c2a06532124e77ec5f4972f078a7d5c
Component: engine
2015-09-21 21:40:46 +02:00
78209a9e2f Merge pull request #16432 from calavera/volume_store
Move volume ref counting store to a package.
Upstream-commit: 2daa5b17353ad0700013641cf7dfc091cbd02c6e
Component: engine
2015-09-21 15:38:06 -04:00
7a04c92cc8 Merge pull request #16437 from runcom/invalid-logger-address
daemon: logger: error out on daemon start if invalid logger address
Upstream-commit: d572bab4a09eb7d60961867d2d2f9896595a3271
Component: engine
2015-09-21 14:53:47 -04:00
a3f8f51f2a Merge pull request #15029 from azurezk/add-version-info
Add docker version info in /info request
Upstream-commit: 40edb5f97c3ba95e450c8280b29d0ef027b51cfb
Component: engine
2015-09-21 11:44:11 -07:00
5a458f78ee Move volume ref counting store to a package.
- Add unit tests to make sure the functionality is correct.
- Add FilterByDriver to allow filtering volumes by driver, for future
  `volume ls` filtering and whatnot.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 72bb56618b522fc3cece7cfd706c56296824673d
Component: engine
2015-09-21 12:46:49 -04:00
8e71940329 add docker server version to /info
Signed-off-by: Zhang Kun <zkazure@gmail.com>
Upstream-commit: 7cf343d1064e3d8211597c67574ff4ddff316fa1
Component: engine
2015-09-21 21:15:32 +08:00
7f1e77e56a Cleanup: remove unnecessary return at the end of block in volumes.go
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 5746eb950130793a1833860b7bc03c2c8fa7b46f
Component: engine
2015-09-21 04:32:37 -04:00
99072d662d Events for OOM needs to be shift to an earlier time
It's worth to warn user as soon as possilbe when OOM happend.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: f05bacbe509823e2ca65583f35188ca09d01db80
Component: engine
2015-09-21 10:18:08 +08:00
72ffa04366 daemon: logger: error out on daemon start if invalid logger address
If an invalid logger address is provided on daemon start it will
silently fail. As syslog driver is doing, this check should be done on
daemon start and prevent it from starting even in other drivers.
This patch also adds integration tests for this behavior.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: e3c472426ff1dccf083e41dbbfdf5935921bf330
Component: engine
2015-09-20 16:20:25 +02:00
64aea80dba Merge pull request #16349 from cpuguy83/16302_deprecate_autocreate_binds
deprecate bind path auto-create
Upstream-commit: e61abac5fa1c1ce2330e34c8eb51d9592dde2dd3
Component: engine
2015-09-18 12:53:06 -07:00
f1ab116cf0 Merge pull request #16403 from runcom/fix-containers-json-emtpy-response
Fix GET /containers/json emtpy response regression
Upstream-commit: 96f9efc0636be5d89fd242e7a5aa96485b80ad01
Component: engine
2015-09-18 11:47:42 -07:00
3a09d2b95a Fix 'rename' error msg and error checking
`docker rename foo ''` would result in:
```
usage: docker rename OLD_NAME NEW_NAME
```
which is the old engine's way of return errors - yes that's in the
daemon code.  So I fixed that error msg to just be normal.

While doing that I noticed that using an empty string for the
source container name failed but didn't print any error message at all.
This is because we would generate a URL like: ../containers//rename/..
which would cause a 301 redirect to ../containers/rename/..
however the CLI code doesn't actually deal with 301's - it just ignores
them and returns back to the CLI code/caller.

Rather than changing the CLI to deal with 3xx error codes, which would
probably be a good thing to do in a follow-on PR, for this immediate
issue I just added a cli-side check for empty strings for both old and
new names. This way we catch it even before we hit the daemon.

API callers will get a 404, assuming they follow the 301, for the
case of the src being empty, and the new error msg when the destination
is empty - so we should be good now.

Add tests for both cases too.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 848792c42e61070adc4107a39d6a044e2ed615f7
Component: engine
2015-09-18 11:12:22 -07:00
cdae9e4a30 events/jsonmessage: add and prefer TimeNano for events
This way provide both Time and TimeNano in the event. For the display of
the JSONMessage, use either, but prefer TimeNano Proving only TimeNano
would break Subscribers that are using the `Time` field, so both are set
for backwards compatibility.

The events logging uses nano formatting, but only provides a Unix()
time, therefor ordering may get lost in the output. Example:
```
2015-09-15T14:18:51.000000000-04:00 ee46febd64ac629f7de9cd8bf58582e6f263d97ff46896adc5b508db804682da: (from busybox) resize
2015-09-15T14:18:51.000000000-04:00 a78c9149b1c0474502a117efaa814541926c2ae6ec3c76607e1c931b84c3a44b: (from busybox) resize
```

By having a field just for Nano time, when set, the marshalling back to
`time.Unix(sec int64, nsec int64)` has zeros exactly where it needs to.
This does not break any existing use of jsonmessage.JSONMessage, but now
allows for use of `UnixNano()` and get event formatting that has
distinguishable order. Example:
```
2015-09-15T15:37:23.810295632-04:00 6adcf8ed9f5f5ec059a915466cd1cde86a18b4a085fc3af405e9cc9fecbbbbaf: (from busybox) resize
2015-09-15T15:37:23.810412202-04:00 6b7c5bfdc3f902096f5a91e628f21bd4b56e32590c5b4b97044aafc005ddcb0d: (from busybox) resize
```

Including tests for TimeNano and updated event API reference doc.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 4026512a2c535fe377a4cf834b7a78fccfd82dab
Component: engine
2015-09-18 13:15:26 -04:00
3afb789aff Fix GET /containers/json emtpy response regression
GET /containers/json route used to reply with and empty array `[]` when no
containers where available. Daemon containers list refactor introduced
this bug by declaring an empty slice istead of initializing it as well
and it was now replying with `null`.

Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 26bd5e3a2da3157f0bcb6654c30b6eccedf7f3f3
Component: engine
2015-09-18 18:44:46 +02:00
4e8ec3d151 deprecate bind path auto-create
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 249f45bcfe1adf4b3550306951f2768b17802217
Component: engine
2015-09-18 10:28:38 -04:00
3904dd3167 Move api/errors/ to errors/
Per @calavera's suggestion: https://github.com/docker/docker/pull/16355#issuecomment-141139220

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: a283a30fb026aad4434a9f2e34f7ce955d27a957
Component: engine
2015-09-17 11:54:14 -07:00
2d5e18cda2 Merge pull request #16355 from duglin/DaemonErrors
Convert some "daemon" static error strings to the new errocode package format
Upstream-commit: 828e4ac45a5b4954997949570b9b032c57137849
Component: engine
2015-09-17 11:48:37 -07:00
3d67e39b1a Merge pull request #16370 from mountkin/daemon-cleanup
remove the unused run() and output() functions in daemon/container.go
Upstream-commit: e33b8b11afd9d2b830ffed11f3c70e7448be1ff4
Component: engine
2015-09-17 17:33:55 +02:00
d13159ba93 Merge pull request #16361 from MHBauer/stats-refactor
refactor stats to not use internal data structures
Upstream-commit: cafee2eb4544442cd1307c1484235261b5b2752a
Component: engine
2015-09-17 08:28:07 -07:00
d6c0223ae2 remove the unused run() and output() functions in daemon/container.go
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: b79782e9516188e4c6e0d2e20d4a42d91f1c0c3c
Component: engine
2015-09-17 19:22:25 +08:00
c2bb8dcb02 Merge pull request #15384 from phil-monroe/15058-include-name-in-syslog-tag
log driver - Interpolate fields into log tag
Upstream-commit: 4dfa996cc246691de5e6f509939b96e8643ac228
Component: engine
2015-09-16 23:33:34 -04:00
b23ea59e6d refactor stats to not use internal data structures
- refactor to make it easier to split the api in the future
 - addition to check the existing test case and make sure it contains
   some expected output

Signed-off-by: Morgan Bauer <mbauer@us.ibm.com>
Upstream-commit: 2d5d606fd368814ead4ff189eeae264f2af8691b
Component: engine
2015-09-16 17:28:52 -07:00
2f2b741d7b Merge pull request #16357 from Microsoft/10662-enabledockervolume
Windows: Enable docker volume
Upstream-commit: b0b3bc56d05ea1de7d5510dd00bb1cb63ac0b0c7
Component: engine
2015-09-16 16:42:50 -07:00
6295202aba Convert some "daemon" static error strings to the new errocode package format
Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: f7d4b4fe2b130a522dee847a657218806180fa52
Component: engine
2015-09-16 16:16:42 -07:00
bd692d4b30 log driver - add ability to interpolate container context into the log tag field
Signed-off-by: Philip Monroe <phil@philmonroe.com>
Upstream-commit: 3be7146e14d1f5ced470c0c7e3066f091f468696
Component: engine
2015-09-16 15:19:28 -07:00
9f76426e0b Windows: Enabled docker volume
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 42a46ed1a4cd1a6116b3bc5018c29c80db93f928
Component: engine
2015-09-16 14:33:13 -07:00
655513db24 Add support for DNS options
Signed-off-by: Tim Hockin <thockin@google.com>
Upstream-commit: 3d4685e258a7729bd0f8cc411b5a73980a9faa20
Component: engine
2015-09-16 14:06:45 -07:00
9ef3eefa22 Merge pull request #16316 from vbatts/vbatts-events
daemon/events: let Log be [slightly] blocking
Upstream-commit: b9a3660d1e007a38585e0bb769169ea0911c0e18
Component: engine
2015-09-16 13:57:06 -07:00
a067d73ef6 Merge pull request #16305 from estesp/hooks-for-the-hooks-gods
Use libcontainer hook for network namespace info passing to libnetwork's sandbox
Upstream-commit: ac34ce0307aeeeba715e16d3cac8e5a7a07a6e1e
Component: engine
2015-09-16 13:55:16 -07:00
5e58ae50d3 Merge pull request #15786 from HuKeping/stats-network
Refactor the statistics of network in docker stats
Upstream-commit: 259a0fb16ceac921763172127183059dea7e3c46
Component: engine
2015-09-16 20:29:16 +02:00
fd675380c0 Revert "Make daemon to start with no userlandproxy by default"
This reverts commit bf2b8ec8165468d7454f6bd86f4a78e7e8b58d8e.

Signed-off-by: Jessica Frazelle <acidburn@docker.com>
Upstream-commit: 50d7fba7758e8890d49f492c284262ec9aa22190
Component: engine
2015-09-16 09:56:38 -07:00
e3b5e8b7ff Update native execdriver to exploit libcontainer hooks
Using @mavenugo's patch for enabling the libcontainer pre-start hook to
be used for network namespace initialization (correcting the conflict
with user namespaces); updated the boolean check to the more generic
SupportsHooks() name, and fixed the hook state function signature.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: e148e763b8e7879855022690fdea88a6bf869195
Component: engine
2015-09-16 12:51:14 -04:00
5aa203fb95 Revert "Make events test more deterministic in go1.5"
This reverts commit 386aefb9fcf65f1a5f68fd61e5108ea0858d2d3f.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: fc77ea787e33864284c14ca743bf3ebc0f50c249
Component: engine
2015-09-15 15:55:18 -04:00
6bc65656e8 daemon/events: let Log be [slightly] blocking
With go1.5's concurrency, the use of a goroutine in Log'ing events was
causing the resulting events to not be in order.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 09e7dd03f8740d7865ea91c56a231ce9ae9bec82
Component: engine
2015-09-15 14:28:22 -04:00
8dd1931b2b volumes: add synchronization to Count and List
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 2d21996eec8d3e6100f19fa0d0fa7adad25285ca
Component: engine
2015-09-15 10:38:53 -07:00
19987593e7 Merge pull request #16285 from calavera/cleanup_volumes_when_create_fails
Remove volume references when container creation fails.
Upstream-commit: 59311faaed4e3384fc8da738a57a25f17ae07e05
Component: engine
2015-09-15 10:55:51 -04:00
700bfcfe4a Merge pull request #15069 from duglin/UseErrorPackage
Use the new error package
Upstream-commit: e91f2c26ce38787e159162d2c4a43744396e3308
Component: engine
2015-09-15 09:28:53 -04:00
852d9066b4 Merge pull request #16275 from coolljt0725/fix_register_failed_and_start
Fix container register failed during daemon start and then start the container
Upstream-commit: db2ac8655d046b97b33636077faa420a700d8bfc
Component: engine
2015-09-15 11:46:03 +02:00
c71aa53e3d Refactor the statistics of network in docker stats
For now docker stats will sum the rxbytes, txbytes, etc. of all
the interfaces.

It is OK for the output of CLI `docker stats` but not good for
the API response, especially when the container is in sereval
subnets.

It's better to leave these origianl data to user.

Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: d3379946ec96fb6163cb8c4517d7d5a067045801
Component: engine
2015-09-15 15:40:34 +08:00
36a12430ca Merge pull request #16282 from mavenugo/ln_uns
Vendor-in libnetwork 2baa2ddc78b42f011f55633282ac63a72e1b09c1
Upstream-commit: 370ca6e401b251085a33f50e842f6567d2e9924e
Component: engine
2015-09-14 22:18:50 -04:00
bfef76b67b Remove volume references when container creation fails.
Volumes are accounted when a container is created.
If the creation fails we should remove the reference from the counter.
Do not log ErrVolumeInUse as an error, having other volume references is
not an error.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 2c6c07752c8d89fa72249c24285ede1b4e579b24
Component: engine
2015-09-14 16:16:46 -04:00
bb8ff26c08 Use the new error package
This is the first step in converting out static strings into well-defined
error types.  This shows just a few examples of it to get a feel for how things
will look. Once we agree on the basic outline we can then work on converting
the rest of the code over.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 628b9a41b09fde3ce1493f7d4f1495b9afaa506c
Component: engine
2015-09-14 13:11:01 -07:00