Commit graph

965 commits

Author SHA1 Message Date
Victor Vieux
590f57752e Revert "--help option and help command should print to stdout not stderr"
This reverts commit 61b129d81802e3c988cc0e67e488b24968dd748a.

Signed-off-by: Victor Vieux <vieux@docker.com>
2014-08-27 18:59:13 +00:00
Dan Walsh
7b9f693120 --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)
2014-08-21 15:35:20 -04:00
Eric Windisch
1387c03c49 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>
2014-08-20 11:19:46 -07:00
unclejack
1595a81343 pkg/tarsum: avoid buf2 allocation in Read
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-08-17 14:45:11 +03:00
Erik Hollensbe
e53a7b767a move utils.Fataler to pkg/log.Fataler
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-13 15:32:41 -07:00
Josiah Kiehl
6d4b3605f7 Extract log utils into pkg/log
Docker-DCO-1.1-Signed-off-by: Josiah Kiehl <josiah@capoferro.net> (github: capoferro)
2014-08-13 15:18:15 -07:00
Michael Crosby
f5d12e100c Exit after receiving SIGTERM
Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-13 12:18:23 -07:00
Alexandr Morozov
e4ec7eadc3 Fix deadlock on failed dial in UDP userland proxy
Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com>
2014-08-13 17:18:37 +04:00
lalyos
76c1b1371b Fix equal short-long version number comparison
Signed-off-by: Lajos Papp <lajos.papp@sequenceiq.com>
2014-08-11 23:40:35 +02:00
lalyos
12bfdf1727 Add test case for identical short and long version numbers
Signed-off-by: Lajos Papp <lajos.papp@sequenceiq.com>
2014-08-11 23:36:09 +02:00
Solomon Hykes
327067ef34 Move signal handling code to pkg/signal.Trap
Signed-off-by: Solomon Hykes <solomon@docker.com>
2014-08-06 17:56:11 +00:00
Michael Crosby
82b1b477ac Merge pull request #7329 from erikh/move_broadcastwriter
Cleanup: utils/broadcastwriter -> pkg/broadcastwriter
2014-08-07 14:51:42 -07:00
Michael Crosby
cfa9032def Graphtest is ok to compile normally
The graphtest package is only imported in the test files of other
packages therefore we do not leak testing flags.

Signed-off-by: Michael Crosby <michael@docker.com>
2014-08-07 14:33:09 -07:00
Peter Bourgon
1543060953 Only import "testing" from *_test.go
This prevents the testing package flags from leaking into the flagsets
of binaries that import docker. I left integration-cli alone.

Docker-DCO-1.1-Signed-off-by: Peter Bourgon <peter@bourgon.org> (github: peterbourgon)
2014-08-07 14:25:21 -07:00
Erik Hollensbe
cc2edda3b8 utils.Debugf -> log.Printf, move jsonlog to own package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:39:01 -07:00
Erik Hollensbe
e722184c25 utils/broadcastwriter -> pkg/broadcastwriter
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-08-06 16:37:01 -07:00
Tianon Gravi
286bd69270 Replace "amd64" build tags with "cgo" as appropriate, and remove where unnecessary
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-08-06 17:20:21 -06:00
Tianon Gravi
dec28e592c Purge the bits of pkg/system that moved to libcontainer/system
Signed-off-by: Andrew Page <admwiggin@gmail.com>
2014-08-02 01:35:04 -06:00
Michael Crosby
5ba812967e Merge pull request #7312 from tianon/update-libcontainer
Bump libcontainer dep
2014-07-31 15:20:07 -07:00
Tibor Vass
6b2fccd531 Merge pull request #7324 from erikh/move_tarsum
Move tarsum to pkg/
2014-07-31 16:56:24 -04:00
Tianon Gravi
f8d5101f19 Remove pkg/user now that it's embedded in libcontainer
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon)
2014-07-31 12:46:39 -06:00
Erik Hollensbe
241c9b56dd utils.Debugf -> fmt.Printf
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 08:42:53 -07:00
Tibor Vass
f7cec086a6 Add OS to docker info
Docker-DCO-1.1-Signed-off-by: Tibor Vass <teabee89@gmail.com> (github: tiborvass)
2014-07-30 10:37:52 -04:00
Erik Hollensbe
07cec009c8 move testdata to tarsum package.
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 06:52:24 -07:00
Erik Hollensbe
7c58e704bc utils/tarsum* -> pkg/tarsum
Docker-DCO-1.1-Signed-off-by: Erik Hollensbe <github@hollensbe.org> (github: erikh)
2014-07-30 06:42:12 -07:00
Erik Hollensbe
c91872166b 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)
2014-07-29 13:09:10 -07:00
Victor Vieux
de3aec0865 Merge pull request #7272 from unclejack/create_httputils_pkg
move resumablerequestreader to pkg/httputils
2014-07-29 12:18:10 -07:00
unclejack
1d56b93f84 move resumablerequestreader to pkg
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-07-29 16:30:45 +03:00
Victor Vieux
9f4db5ab98 Merge pull request #7210 from fcarriedo/refactor-common-code
pkg/units: Refactor common code
2014-07-28 11:45:46 -07:00
Francisco Carriedo
2261fc98e1 pkg/units: Updated tests with unit constants
Also, now that I was at it, gave them a small refactor.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-26 20:00:18 -07:00
Francisco Carriedo
804ea3b58e pkg/units: Unit constants directly int64
int64 seems sufficient

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-26 20:00:08 -07:00
fcarriedo
16fedac8f0 pkg/units: including suggestions and enhancements
Docker-DCO-1.1-Signed-off-by: fcarriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-25 09:33:04 -07:00
Victor Vieux
bb2a94eeef update go import path and libcontainer
Docker-DCO-1.1-Signed-off-by: Victor Vieux <vieux@docker.com> (github: vieux)
2014-07-24 22:19:50 +00:00
fcarriedo
5b2827a2f4 pkg/units: Updated Compile() to MustCompile()
We were doing exactly what `regexp.MustCompile()` already does.

Docker-DCO-1.1-Signed-off-by: fcarriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-24 13:19:20 -07:00
Francisco Carriedo
cf6402681b pkg/units: Refactored common code to single func
Both functions perform the same logic and they just vary on the base
multiplication units. We can refactor the common code into a single
place.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-24 00:03:59 -07:00
Francisco Carriedo
e8322a7fd7 pkg/units: Moved 'units' out of function
No need to initialize every time the function executes since it works as
a catalog.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-24 00:03:59 -07:00
Francisco Carriedo
7595bd19d8 pkg/units: Compacted var declaration and initialization
No need to have two lines. The type is even explicit when type casting
to `float64(size)`

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-24 00:03:40 -07:00
Francisco Carriedo
d56f2248e4 pkg/units: Refactor regexp.Compile to init()
No need to recompile a fixed regular expression each time the function
executes. Abstracting it to the `init()` method.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-23 23:45:03 -07:00
Francisco Carriedo
f26b6b00d3 pkg/units: Standardized supported sizes
May make sense that both `FromHumanSize()` and `RAMInBytes()` support
the same units. Added 'PB' to the RAMInBytes regex.

Also updated tests.

Note: int64 is overflowed on quantities >= EB

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-23 23:37:06 -07:00
Francisco Carriedo
299020949f pkg/units: Using 'case' instead of trickled ifs
Seems the perfect case for 'case' ;).

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-23 20:38:36 -07:00
Michael Crosby
5b5f71a7e6 Merge pull request #7164 from fcarriedo/not-error-as-var-name
pkg/units: Better to not use `error` as var name
2014-07-23 11:04:03 -07:00
Michael Crosby
b91d46a05c Merge pull request #7167 from unclejack/maintainer_truncindex
pkg/truncindex: add unclejack to MAINTAINERS
2014-07-22 17:10:38 -07:00
Francisco Carriedo
c5a5c6dff1 pkg/units: Better to not use error as var name
Better to not use `error` as var name (might eclipse the error type) for
clarity and to prevent subtle bugs.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-22 15:39:59 -07:00
unclejack
bfd14970fe pkg/truncindex: add unclejack to MAINTAINERS
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com> (github: unclejack)
2014-07-22 23:08:28 +03:00
Francisco Carriedo
6f59de0294 pkg/units: Remove unused named returns
Remove named returns since not used in function body.  Might prevent
potential subtle bugs.

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-22 12:16:50 -07:00
Francisco Carriedo
23f29beb82 pkg/units: Increased test coverage. Closes #7159.
Increased coverage:

  * Added test cases to size_test.go
  * Added coverage for duration.go

Docker-DCO-1.1-Signed-off-by: Francisco Carriedo <fcarriedo@gmail.com> (github: fcarriedo)
2014-07-22 09:56:58 -07:00
Michael Crosby
fdff0c00b0 Merge pull request #7061 from muchweb/rms
Can't believe you forgot RMS
2014-07-21 12:02:45 -07:00
Michael Crosby
837a8cf572 Don't create pty slave in the daemon for native driver
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@docker.com> (github: crosbymichael)
2014-07-16 16:57:19 -07:00
s-ko
b828dfcb6f Removed :neckbeard: RMS test case
Docker-DCO-1.1-Signed-off-by: Aleksandrs Fadins <aleks@s-ko.net> (github: muchweb)
2014-07-16 23:22:21 +01:00
s-ko
4054fe2898 Added :neckbeard: RMS the founder of 🐃 GNU and 🆓 as in 🆓dom software
Docker-DCO-1.1-Signed-off-by: Aleksandrs Fadins <aleks@s-ko.net> (github: muchweb)
2014-07-16 22:45:08 +01:00