Commit Graph

753 Commits

Author SHA1 Message Date
3443a67be3 pkg/tarsum: fix panic with dynamic buffer
When read is called on a tarsum with a two different read sizes, specifically the second call larger than the first, the dynamic buffer does not get reallocated causing a slice read error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 5cdf7f507771e159ddd335f3757cd33f7ba4e426
Component: engine
2014-09-25 15:58:35 -07:00
a6c06e4ad8 Test for jsonlog.WriteLog
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 2add198a7abc084dd394f61ed26057ec5d639a4c
Component: engine
2014-09-23 19:19:25 +04:00
8dd6b83d46 Benchmark for jsonlog.WriteLog
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 81c9927f8f3c190ed9dd15b62716a240ce20fc51
Component: engine
2014-09-23 18:24:18 +04:00
680ee7cfce Merge pull request #5956 from vbatts/vbatts-tarsum_hashes
tarsum: allow for generic hashes
Upstream-commit: 350b1cf6ea5681e26ea752e2e54ef6c9a04d91e0
Component: engine
2014-09-22 11:11:25 -07:00
98789bf31d pkg/jsonlog: avoid JSONLog allocation in loop
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 473bb5274ce7a520bc73ccb3529f99729a799062
Component: engine
2014-09-22 18:57:28 +03:00
f5deb7d0f9 Close logs pipes and catch write errors
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: a7ee201ee85c95afb8556323d79e32cf9e2d8737
Component: engine
2014-09-22 10:55:46 +04:00
750e7b6a57 Change unused WriteCloser to Writer
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: fd3f2e175fa6ddb606d2c681ff86a97faccfebbd
Component: engine
2014-09-22 10:54:58 +04:00
9e6770baa4 FIX 6613:launch docker fail with space named drive
Signed-off-by: Guillaume Dufour <guillaume.duff@gmail.com>
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: acea488eb6ed40e6e5894e1b259ad861c9a98042
Component: engine
2014-09-19 12:07:53 -04:00
1192584d04 Merge pull request #6950 from jfrazelle/6831-check-flag-centos6.5
Fix duplicate iptables rules
Upstream-commit: d5537e0f039512c322efa6aec176349eff731499
Component: engine
2014-09-18 17:51:15 -07:00
e5b81f13f8 tarsum: allow for alternate block ciphers
Not breaking the default cipher and algorithm for calculating checksums,
but allow for using alternate block ciphers during the checksum
calculation.

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 4e9925d780665149b8bc940d5ba242ada1973c4e
Component: engine
2014-09-18 10:34:58 -04: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
c978982604 Merge pull request #7889 from vbatts/vbatts-tarsum_name_collision
tarsum: name collision fix
Upstream-commit: 458b019e62bd41da08b99d49db9b2ee079fee29a
Component: engine
2014-09-17 21:59:39 +03:00
b0b8a2773b tarsum: name collision fix
If a tar were constructed with duplicate file names, then depending on
the order, it could result in same tarsum.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: c5e6362c53cbbc09ddbabd5a7323e04438b57d31
Component: engine
2014-09-17 14:37:46 -04:00
995ea10dab Benchmark for StdWriter.Write
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: 55cac6c9421702ca1e42b3e3f92266e865a5c769
Component: engine
2014-09-17 19:24:07 +04:00
1aa081f9b0 stdcopy: improve perf by avoiding buffer growth
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 277aa9c67415b9b76ab17daea583b51f8560a6a5
Component: engine
2014-09-17 18:06:17 +03: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
a9aedbcc8a use custom marshalling for JSONLog
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 9851e8c4c18a89327ec2c1f04e36c9932c4231c1
Component: engine
2014-09-17 17:03:54 +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
c4f90f34f5 Merge pull request #8063 from jlhawn/tarsum_empty_tar_archive
tarsum: correct close and finish reads
Upstream-commit: 0a6fd743ea7b0b312620e8b0f51d576a3f71f07c
Component: engine
2014-09-16 15:41:28 -04:00
aa9173b397 Merge pull request #8059 from estesp/8057-refactor-regexp-to-package-var
Refactor all pre-compiled regexp to package level vars
Upstream-commit: 28f09f06326848f4117baf633ec9fc542108f051
Component: engine
2014-09-16 15:04:23 -04:00
b4607092ee Refactor all pre-compiled regexp to package level vars
Addresses #8057

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
Upstream-commit: 4119c9d7d955757092adc3410da8d75f972bd3c1
Component: engine
2014-09-16 12:57:44 -04:00
b6e3f16eca Correct tarsum finish logic
Tarsum now correctly closes the internal TarWriter which appends
a block of 1024 zeros to the end of the returned archive.

Signed-off-by: Josh Hawn <josh.hawn@docker.com>
Upstream-commit: bc956c6b79dbe9cc7a1ab198f92b6843d072eb28
Component: engine
2014-09-16 09:34:21 -07:00
9a18f893c7 tarsum: version the addition of xattrs
Now that TarSum can be versioned, move the addition of xattr headers in
to the next version of TarSum

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 0ecafb8a6909f5d342246aefb9ac97350cef6558
Component: engine
2014-09-15 16:08:05 -04:00
52ac5025c9 tarsum: include xattr headers in to the checksum
this is to enhance the tarsum algorithm, but _MUST_ be done in lock step
with the same for docker-registry. (PR will be cited)

Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
Upstream-commit: 448c8ecb0fb453bb29fcada5e7486355ccfadbe9
Component: engine
2014-09-15 15:05:01 -04:00
4dcbf56012 tarsum: TarSum is not the interface
don't export the exsisting TarSum struct and call the interface 'TarSum'
instead.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: ec01eb653db9d5e5b9291c1670dde57e7f742874
Component: engine
2014-09-10 21:56:20 -04:00
5f275ccb1b TarSum: versioning
This introduces Versions for TarSum checksums.
Fixes: https://github.com/docker/docker/issues/7526

It preserves current functionality and abstracts the interface for
future flexibility of hashing algorithms. As a POC, the VersionDev
Tarsum does not include the mtime in the checksum calculation, and would
solve https://github.com/docker/docker/issues/7387 though this is not a
settled Version is subject to change until a version number is assigned.

Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 747f89cd327db9d50251b17797c4d825162226d0
Component: engine
2014-09-10 15:41:52 -04:00
1c4a4c9a65 Merge pull request #7921 from unclejack/increase_tarsum_buffer_size
pkg/tarsum: make buffer size dynamic
Upstream-commit: 197f9b1e2b5810bbbd38b95b1d68c586033fad7c
Component: engine
2014-09-09 16:10:02 -04:00
855ab1fce7 tarsum: use Debugf, not Infof
Signed-off-by: Vincent Batts <vbatts@redhat.com>
Upstream-commit: 6a8cae3e03d7253f2013b6c56eef64b18aea038f
Component: engine
2014-09-09 14:07:20 -04:00
4e7b27c469 Fix duplicate iptables rules
If iptables version is < 1.4.11, try to delete the rule vs. checking if it exists. Fixes #6831.

Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jfrazelle@users.noreply.github.com> (github: jfrazelle)
Upstream-commit: f3a68ffa390fb851115c77783fa4031f1d3b2995
Component: engine
2014-09-07 15:12:19 -07:00
5b1656c927 pkg/tarsum: add dynamic buffer sizing
This commit makes tarsum buffer allocation dynamic. This change
is required to avoid allocating memory excessively after the archive
buffering changes.

Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 7ef34407509fa76e3ead12a20c8b731f434e1971
Component: engine
2014-09-06 17:39:43 +03:00
fca073bcf7 pkg/pool: add pools for bufio readers & writers
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 2d2016b81b1f313cda2c8f145844b162352ba234
Component: engine
2014-09-03 11:36:39 +03:00
dd97f278a0 pkg/ioutils: add ReaderErrWrapper to readers
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: bd130e72a06dc3e8de521ce365bf4933f36b2417
Component: engine
2014-09-03 11:36:21 +03:00
dca3941db1 pkg/ioutils: add NewBufReaderWithDrainbufAndBuffer
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: c93b9e81c03168ca69def94ba231d2ecc6672ce9
Component: engine
2014-09-03 11:36:21 +03:00
0e15abc25d pkg/ioutils: add WriteCloserWrapper
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 7b6f34057cee94bf22e4e58cd164731e6b0e8851
Component: engine
2014-09-03 11:36:21 +03: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
ba45bffa03 Merge pull request #7809 from LK4D4/use_increment
Use increment operator
Upstream-commit: ec87846908287fd87d628a4b74f26e96c9c5f9cc
Component: engine
2014-09-01 11:16:25 -07:00
fe6985381c Use increment operator
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
Upstream-commit: 16e850fe3ea42f5103c9a11f3db17d11dc4f6ada
Component: engine
2014-08-30 21:43:48 +04:00
5867aa701f fs.Visit() returns nil flag
Signed-off-by: Sven Dowideit <SvenDowideit@docker.com>
Upstream-commit: f1934e59790c9af6466075d3d050386627ad1a9a
Component: engine
2014-08-29 15:38:03 +10:00
e0cd0203dd Merge pull request #7647 from ewindisch/erw-tarsum-maintainer
Add Eric Windisch to MAINTAINER for tarsum
Upstream-commit: 334dca15b0800cbbac99dc784d977ae0e094c716
Component: engine
2014-08-27 20:00:19 -07:00
31ac70b2be pkg/networkfs/etchosts: tests for Update method
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 9f09ef18a44d6e14da3d8a60d923de9e38ffc33e
Component: engine
2014-08-27 18:23:41 -07:00
303526eefd pkg/graphdb: tests for Parents and Children
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
Upstream-commit: 925a3254e757407c5bfea5575df3b807f6596e70
Component: engine
2014-08-27 18:23:41 -07:00
ac32065d5c Update /etc/hosts when linked container is restarted
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
Upstream-commit: 450740c891c60dda15b7abe29f35b8e142c2c40e
Component: engine
2014-08-27 18:23:41 -07:00
3cca8404b4 add the [OPTIONS] string automatically if there are flags defined
Signed-off-by: SvenDowideit <SvenDowideit@home.org.au>

Docker-DCO-1.1-Signed-off-by: SvenDowideit <SvenDowideit@home.org.au> (github: SvenDowideit)
Upstream-commit: 8c6c4a12b7bd53c01998988593789aa16a6d9ac8
Component: engine
2014-08-28 08:50:50 +10:00
676eea0fcd Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d81802e3c988cc0e67e488b24968dd748a.

Signed-off-by: Victor Vieux <vieux@docker.com>
Upstream-commit: 2e489073d94a7e2a5df115704a484c34f0b59f29
Component: engine
2014-08-27 18:59:13 +00:00
f13f1856df --help option and help command should print to stdout not stderr
--help and help are successful commands so output should not go to error.

QE teams have requested this change, also users doing docker help | less
or docker run --help | less would expect this to work.

Usage statement should only be printed when the user asks for it.
Errors should print error message and then suggest the docker COMMAND --help
command to see usage information.

The current behaviour causes the user to have to search for the error message
and sometimes scrolls right off the screen.  For example a error on a
"docker run" command is very difficult to diagnose.

Finally erros should always exit with a non 0 exit code, if the user
makes a CLI error.

Docker-DCO-1.1-Signed-off-by: Dan Walsh <dwalsh@redhat.com> (github: rhatdan)
Upstream-commit: 61b129d81802e3c988cc0e67e488b24968dd748a
Component: engine
2014-08-21 15:35:20 -04:00
fb6f6f58b2 Add Eric Windisch to MAINTAINER for tarsum
This code is vital to the security of the project and it is important
we assure it is well-maintained and guarded.

I am vested in assuring this code maintains security and
provides as much compatibility as possible between releases.

Signed-off-by: Eric Windisch <eric@windisch.us>
Upstream-commit: cd71f92a7fda7a8bdf328a91c37a759463862aeb
Component: engine
2014-08-20 11:19:46 -07:00
e56ddc1f46 pkg/tarsum: avoid buf2 allocation in Read
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
Upstream-commit: 55533693be0f268d7d7a2d339369ce8617398542
Component: engine
2014-08-17 14:45:11 +03: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
14291aae78 Exit after receiving SIGTERM
Signed-off-by: Michael Crosby <michael@docker.com>
Upstream-commit: cdf8a55670793a135a53549c5e1877c33a66be0c
Component: engine
2014-08-13 12:18:23 -07:00