Commit Graph

365 Commits

Author SHA1 Message Date
a84cb1fe40 Move Matches() file path matching function into pkg/fileutils
This is the second of two steps to break the archive package's
dependence on utils so that archive may be moved into pkg. `Matches()`
is also a good candidate pkg in that it is small, concise, and not
specific to docker internals

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: 73f4bfed810b65943f1d9d038a8db9bd834067fa
Component: engine
2014-09-29 23:21:41 -07:00
3ffb3fc6cc Move Go() promise-like func from utils to pkg/promise
This is the first of two steps to break the archive package's dependence
on utils so that archive may be moved into pkg.  Also, the `Go()`
function is small, concise, and not specific to the docker internals, so
it is a good candidate for pkg.

Signed-off-by: Rafe Colton <rafael.colton@gmail.com>
Upstream-commit: b845a62149d5f4990462ac6c9167c5cfaa0e66cb
Component: engine
2014-09-29 23:16:27 -07:00
7c11f5dee8 Replace utils.CheckLocalDns with bytes.Contains line
Since RemoveLocalDns patch will  remove all localhost entries
from resolv.conf we no longer need anything more then
!bytes.Contains(resolvConf, []byte("nameserver")

To check for no nameserver entry in dns config.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: a297d6ab8c08a13503fd004ec1ad7ee9e23bd22a
Component: engine
2014-09-29 06:37:31 -04:00
b90aac66ac Remove nameserver 127.0.0.1 line rather then dumping resolv.conf
We have a bug report complaining about docker dumping the contents of the
hosts resolv.conf if it container 127.0.0.1.  They asked that instead
of dropping the file altogether, that we just remove the line.

This patch removes the 127.0.0.1 lines, if they exist and then
checks if any nameserver lines exist.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 65640994fda8e1667de3642d8f4daf76dd3de302
Component: engine
2014-09-29 06:37:31 -04:00
dd63155260 Merge pull request #7942 from estesp/7747-stderr-stdout-bug
Fix gh#7747: filter bare newline output and log client pull to stdout
Upstream-commit: 28e308c25ed431da14bf010df8a9beca05b32018
Component: engine
2014-09-22 10:53:34 -07:00
a701f25898 Merge pull request #8041 from unclejack/lower_allocations_broadcastwriter
lower the number of allocations in broadcastwriter
Upstream-commit: 77d30e71122c7ec328f79836dcab4409f72e04b9
Component: engine
2014-09-17 15:26:44 -07:00
ba4bc005be move stdcopy to pkg/stdcopy
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 1f03e60c2a96a92acae0e4d2fd604ab2c6d55473
Component: engine
2014-09-17 18:06:17 +03:00
cb5f7b942d add the timeutils package
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9ae3134dc9f0652ef48ec1fd445f42d8fe26de35
Component: engine
2014-09-17 14:30:08 +03:00
bcad074599 Merge pull request #7976 from duglin/Issue7902
Fix for issue 7902 - add trailing zeros to timestamps so logs align
Upstream-commit: 51b26853ef2f124ea837364c02585cbf96999d6a
Component: engine
2014-09-16 13:55:03 -07:00
a36831cc2a Fix for issue 7902.
Use utils.RFC3339NanoFixed ("2006-01-02T15:04:05.000000000Z07:00")
instead of time.RFC3339Nano to format our log timestamps - this way
things are aligned, in particular the nano seconds are padded with zeros

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: cd7a5f5c0998f288f71d307076e661ed54f1a5f1
Component: engine
2014-09-16 10:28:37 -07:00
d0a61e9c18 Improve ValidateContextDirectory error handling.
- Errors sent to the walker callback functions were ignored. This meant that
  one could get a panic when calling methods on a nil FileInfo object. For
  example when the file did not exists any more.

- Lstat calls inside walker callback are reduntant because walker already calls
  Lstat and passes the result to the callback.

- Error returned from filepath.Rel() can never be EACCES because it compares
  strings and does not care about actual files.

- If Matched() returns error then ValidateContextDirectory() must return error.
  Currently it still kept walking although the outcome was already known. 

- Function will now fail in case of unknown error(not EACCES nor ENOENT).
  Previous implementation did not make a clear decision about this (but 
  panicked because of the issues above).

Signed-off-by: Tõnis Tiigi <tonistiigi@gmail.com> (github: tonistiigi)
Upstream-commit: a8914293fbb1328f9a5c931bd51e34f5d6584e17
Component: engine
2014-09-16 19:17:34 +03:00
53de305780 Fix gh#7747 - filter bare newline output and log client pull to stdout
Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: b5184d3c2417c743b3fec34312270d243e4d980c
Component: engine
2014-09-06 01:06:18 -04:00
e9ab736d16 move some io related utils to pkg/ioutils
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 76212635b594d4472dd8d5b2e071fac416addbe7
Component: engine
2014-09-03 11:36:21 +03:00
cc2787ae0d Some more style fixes
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 114838cbda38f4808d3a7a0d40b33d2ee445d158
Component: engine
2014-08-29 15:21:28 +04:00
2b6c63642e Fix panic in validate context for build
Fixes #7611

Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: cd776cdd77239353d8bd17d3e05d66665f381157
Component: engine
2014-08-25 14:25:31 -07:00
cb2b33e883 Skip permissions check on named pipes
Fixes #7680

Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 07f2e794867030c755901ae5479df03e3c4ce189
Component: engine
2014-08-25 22:59:53 +04:00
b8d5783511 move utils.Fataler to pkg/log.Fataler
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ac63d925d2618e700d117c5d9e402ccc0c5cecc8
Component: engine
2014-08-13 15:32:41 -07:00
4737f7cea5 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
Upstream-commit: a02f67be5b17da63d475e6f35956c1e72c3b2e7b
Component: engine
2014-08-13 15:18:15 -07:00
bdc2cfec82 Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
Upstream-commit: bc9f5cdeb5c000de5be291a5628d6eb99c1ab91d
Component: engine
2014-08-07 14:51:42 -07:00
325695b856 utils.Debugf -> log.Printf, move jsonlog to own package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 5cdb9c8acab75df74d20cd937e4091dacb355160
Component: engine
2014-08-06 16:39:01 -07:00
00eca7c915 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 5ab09f2f7129225220fc9c0b76b2e2aec6823ee1
Component: engine
2014-08-06 16:37:01 -07:00
a195939eec Separate events subsystem
* Events subsystem merged from `server/events.go` and
  `utils/jsonmessagepublisher.go` and moved to `events/events.go`
* Only public interface for this subsystem is engine jobs
* There is two new engine jobs - `log_event` and `subscribers_count`
* There is auxiliary function `container.LogEvent` for logging events for
  containers

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
[solomon@docker.com: resolve merge conflicts]
Signed-off-by: Solomon Hykes <solomon@docker.com>
Upstream-commit: 8d056423f8c433927089bd7eb6bc97abbc1ed502
Component: engine
2014-08-06 10:08:19 +00:00
05babb14b7 Docker should use /var/lib/container/tmp for large temporary files.
/tmp is often a tmpfs file system and large temporary files could cause
docker commands to fail.  Also using /tmp potentially allows users on the
system to get access to content, or even attack the content.  Moving the tmpdir to
/var/lib/container/tmp will protect the data.

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

Conflicts:
	docker/docker.go
Upstream-commit: b4813f2841638be28208b7b1602f12750a46ece9
Component: engine
2014-08-05 16:43:42 -04:00
1d296af9b5 Merge pull request #7357 from crosbymichael/docker-ignore
Fix .dockerignore when ignoring unreadable dirs
Upstream-commit: c5cdbc376ffaa1ed9db038e93acaa1fc689433b6
Component: engine
2014-07-31 15:19:50 -07:00
604012d742 Fix .dockerignore when ignoring unreadable dirs
The initial `ValidateContextDirectory` implementation fails loudly when a file
lacks read permissions in the current context. However that situation is valid
if the file is included in the `.dockerignore` patterns.

Docker-DCO-1.1-Signed-off-by: Bruno Renié <brutasse@gmail.com> (github: brutasse)
Upstream-commit: 27cca4c70cc7f0cccfda693ca7bbb2422eec3e13
Component: engine
2014-07-31 15:10:56 -07:00
be277e6761 Merge pull request #7324 from erikh/move_tarsum
Move tarsum to pkg/
Upstream-commit: 531f5907d64ff56b0beea1de11d65885e29ee5ad
Component: engine
2014-07-31 16:56:24 -04:00
8be33461d7 Remove CheckSum from utils; replace with a TeeReader
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: ef6b78f7db890a79b40484fd892ff486017ff2e9
Component: engine
2014-07-30 11:23:43 -07:00
3d1163e7b4 move testdata to tarsum package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4184cccb0f291b329292da1a31108407cb1a4750
Component: engine
2014-07-30 06:52:24 -07:00
5a8e5fe7dc utils/tarsum* -> pkg/tarsum
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 1219e458d105461fd7de23fa4b04a1233f61f8a4
Component: engine
2014-07-30 06:42:12 -07:00
e25f77248d Move parsing functions to pkg/parsers and the specific kernel handling
functions to pkg/parsers/kernel, and parsing filters to
pkg/parsers/filter. Adjust imports and package references.

Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 4398108433121ce2ac9942e607da20fa1680871a
Component: engine
2014-07-29 13:09:10 -07:00
b812e976e3 Merge pull request #7272 from unclejack/create_httputils_pkg
move resumablerequestreader to pkg/httputils
Upstream-commit: 3bae02cbe32b856107a5d61c496f35d69c35aa2d
Component: engine
2014-07-29 12:18:10 -07:00
b7f9603931 move resumablerequestreader to pkg
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c0517857f64d1148d02809e3ba3dd39bf8322ed3
Component: engine
2014-07-29 16:30:45 +03:00
b178420296 jsonmessage: added test and cleaned up others
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 704b97d1c4cc6eaa6ecf9630eed2dffd5abaffb9
Component: engine
2014-07-28 14:43:28 -04:00
ddd05d0cc1 progress bar: don't strings.Repeat a negative number
Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 77237be0e23dfaba4d4d97a525c3ecc7fb819042
Component: engine
2014-07-28 12:01:43 -04:00
1da81ba363 Fix io.Reader ambiguity on EOF in progressreader
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: caa57699283fd0fa47cac59c80adcacaa5c9950e
Component: engine
2014-07-25 19:26:27 -04:00
6ae4c9014c update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: b3ee9ac74e171e00f14027e39278013629e681b8
Component: engine
2014-07-24 22:19:50 +00:00
c7d6337458 resumablerequestreader: allow initial response
Make it possible to inspect an initial response and pass it to
ResumableRequestReader. This makes it possible to inspect an initial
response and passing it to ResumableRequestReader to avoid making an
extra request.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: f033ce3ee9ee055612acacde537687e41865e14f
Component: engine
2014-07-21 19:54:25 +03:00
669e2fe479 add basic support for 'all'
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 222a6f44016451dcbd2da0003e64521c06e88ba9
Component: engine
2014-07-11 23:43:21 +00:00
ca489c2f49 Basic --cap-add and --cap-drop support for native
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 94e6dc978134b61a2b30aa9118f98f6fadd10535
Component: engine
2014-07-11 23:43:21 +00:00
34b700c7bf Updated docker logs timestamp to RFC3339
Currently the docker logs timestamp flag generates log entries like:

    $ sudo docker logs -ft daemon_dave
    [May 10 13:06:17.934] hello world

It uses Go's StampMilli timestamp to generate the timestamp. The entry
is also wrapped in [ ].

This is non-standard operational timestamp and one that will require
custom parsing.

The new timestamp is RFC3999Nano and generates entries like:

    2014-05-10T17:42:14.999999999Z07:00 hello world

These are readily parsed by tools like ELK.

Docker-DCO-1.1-Signed-off-by: James Turnbull <james@lovedthanlost.net> (github: jamtur01)

Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
Upstream-commit: aa0eca03e6662c5f6b4f0f47190a45f49b61e357
Component: engine
2014-07-09 11:59:06 -04:00
31988404b5 BroadcastWriter refactoring
It became slightly faster and lighter
possibly fixes #5923 problems

Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 7bdd23bfeec1968a3061e63e24af049837baf4c4
Component: engine
2014-07-03 10:12:53 +04:00
eec6ca2f45 Benchmark for BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: a8d95b7c573dedad26395372dd0d4ff8882f6cb6
Component: engine
2014-07-03 10:06:58 +04:00
4d29e9b718 Move WriteBroadcaster to separate package as BroadcastWriter
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: 9d4e80222144c0aef3e78202ecb4904b3ce5ed9b
Component: engine
2014-07-02 23:31:06 +04:00
1ce22444ec Move truncindex in separate package in pkg/
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: ed032ddfd68a8654671a13d676c0f7539e36a10b
Component: engine
2014-06-24 21:19:15 +04:00
7e8e4bdc76 Fix stdcopy when reads large frame at once
Fixes TestLogsContainerMuchBiggerThanPage with go 1.3(#6520)
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
Upstream-commit: d17c92965937bbc3181b73bb8a4e21ecee217e5f
Component: engine
2014-06-19 21:42:55 +04:00
d80bc787e6 Merge pull request #6257 from proppy/test-conntimeout
utils: add test for TimeoutConn
Upstream-commit: 1ca7964cdd6ee1b34067593e9196c9415345199f
Component: engine
2014-06-18 16:23:39 -07:00
172faefd3c Fix go vet errors
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)

Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: f08cd445b0d2e44a4977a3bd0dca0a1cd4e76d2f
Component: engine
2014-06-18 17:39:57 +00:00
3fdde76d71 Merge pull request #6490 from icecrime/6203-artifacts_on_events_output
Avoid erasing line for non-progress messages
Upstream-commit: f0ec9018194e9fddecfde29050aed1169c1fe94c
Component: engine
2014-06-17 16:26:51 -07:00
1d007f754c Merge pull request #6199 from icecrime/event_subscription_refactoring
Event subscription refactoring
Upstream-commit: d0fe1147ea6bb98e87a573f078e1572f6061e04b
Component: engine
2014-06-17 17:39:28 -04:00
43d16abb08 Merge pull request #6320 from LK4D4/fix_stdcopy_eof
Don't exit on eof in header reading in stdcopy
Upstream-commit: 4dcf4e9bd0e9c68369dd73fb8dfbf419e0ab68d6
Component: engine
2014-06-17 14:20:13 -07:00