Commit Graph

22565 Commits

Author SHA1 Message Date
4b3ca35355 Merge pull request #20602 from twistlock/20508_authz_plugin_corrupt_body
Fix #20508 - Authz plugin enabled with large text/JSON POST payload corrupts body
Upstream-commit: abbb16d7abd7150a9226252f2544326930ea2baf
Component: engine
2016-02-29 10:43:02 -05:00
8c7db25ed0 Merge pull request #20756 from runcom/no-dash-d-tests
integration-cli: remove not necessary -d again
Upstream-commit: 7cea7c698d39adb9757ee59beed59f114c88f132
Component: engine
2016-02-29 09:47:49 -05:00
c247f38736 Merge pull request #20736 from elchris82/master
Changed the Example request in Remote API reference to connect a container to a network
Upstream-commit: 79c24a082004251bd899b8bd549da43e3abca10d
Component: engine
2016-02-29 15:06:20 +01:00
351fe56c91 Merge pull request #20771 from Microsoft/jjh/disableunittestsdistribution
Windows CI Unit Test: Distribution turn off failing tests
Upstream-commit: da4f2ce6294f9333a7b9011f80d7b64815cc2059
Component: engine
2016-02-29 12:56:10 +01:00
b26295c87c Merge pull request #20776 from terryding77/doc_changes
change container word spell in docs
Upstream-commit: ffd8a0e0fbaaf4f8dbaea66c3e06a8dc24dc22ca
Component: engine
2016-02-29 10:38:06 +01:00
7294d486c4 change container word spell in docs
Signed-off-by: terryding77 <550147740@qq.com>
Upstream-commit: adda1060aa3c7a41fddc4cdeaac92f946c40e2d8
Component: engine
2016-02-29 16:59:53 +08:00
4eae9fd26d Merge pull request #20753 from icecrime/debugging_win2lin
Fix client-side race in `docker stats`
Upstream-commit: 5ef74c65956eaf59bc1c4537f5244f56b37ef531
Component: engine
2016-02-29 08:20:17 +01:00
5f0c16d34d Merge pull request #20604 from coolljt0725/fix_reload
Fix configuration reloading
Upstream-commit: 20a038eca68e4188e1cd812293aea8cb220cf08f
Component: engine
2016-02-29 07:14:15 +01:00
f53e7a1a3f Windows CI Unit Test: Distribution turn off failing tests
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 621a1b9aca7f0ad2ac6b83f990644c3dc983d659
Component: engine
2016-02-28 20:02:51 -08:00
26d7a7de66 Fix client-side race in docker stats
Subscribe to events and monitor for new containers before the initial
listing of currently running containers.

This fixes a race where a new container could appear between the first
list call but before the client was subscribed to events, leading to a
container never appearing in the output of `docker stats`.

Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 3041aa53efbbfddbc10a66027d973bd353e3b525
Component: engine
2016-02-28 18:44:23 -08:00
47c5b544ef Merge pull request #20760 from vdemeester/fix-cliconfig
Fixing cliconfig getDefaultConfigDir
Upstream-commit: 67a77934a436e9995a5322178db7cea56a9458dc
Component: engine
2016-02-29 00:19:06 +01:00
ab5d00b5e0 Merge pull request #20757 from spacediver/patch-1
fixed formatting; added handy -y to apt-get install
Upstream-commit: ab18b5977a2e12a425bfe4961f58784e450fd0d0
Component: engine
2016-02-28 23:55:03 +01:00
5548386ebd Merge pull request #20759 from toogley/master
add google group subscribtion method using only emails
Upstream-commit: 0866d63278b250cd19d560aa748941be24246a45
Component: engine
2016-02-28 19:17:00 +01:00
bd7351183c fixed formatting; added handy -y to apt-get install
Signed-off-by: Pavel Sutyrin <pavel.sutyrin@gmail.com>
Upstream-commit: 30c2770a736e6c731f4046431f0f4275dadbd536
Component: engine
2016-02-28 20:37:04 +03:00
c006d48f55 Fixing getDefaultConfigDir
It seems it's not really checking the right folder.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: d3fd0974d558aa994f9f5da7ff84dceb2c7e1c90
Component: engine
2016-02-28 16:04:48 +01:00
21e60713b2 add google group subscribtion method using only emails
* users don't have to create an google account for using the google groups. They
  can simply email to e.g. "docker-user+subscribe@googlegroups.com" to
  subscribe.

* since this behavior is not mentioned on the google group website, i think its
  a good idea to explain this method here.

Signed-off-by: toogley <toogley@mailbox.org>
Upstream-commit: e3e18584b0552159324d93cb394b04594057adbc
Component: engine
2016-02-28 15:31:15 +01:00
f444846f4e integration-cli: remove not necessary -d again
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: e44689139d2ffd08c147ffe940a15a8e8616786a
Component: engine
2016-02-28 13:48:15 +01:00
7ca3972412 Merge pull request #20748 from runcom/remove-dash-d
integration-cli: remove not necessary -d
Upstream-commit: 38439733d2415f2d12290bf5bf8b7c1133557f79
Component: engine
2016-02-27 21:58:15 -05:00
79c9ac5435 Merge pull request #20706 from calavera/remove_concurrent_access_to_stdtypes
Make stdcopy.StdWriter thread safe.
Upstream-commit: ec268be52ee3a2fab5c792ecf836f109595712ae
Component: engine
2016-02-27 21:14:09 -05:00
2d692cbf2f Merge pull request #20752 from icecrime/fix_experimental_cross
Pin tpoechtrager/osxcross commit
Upstream-commit: 15bdca6addef2cc3918a3c56685cc6cd81cfbab5
Component: engine
2016-02-27 17:43:43 -08:00
588f1dc8ae Pin tpoechtrager/osxcross commit
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 2140650b56342898f7efb700bf4a681073b64ee5
Component: engine
2016-02-27 12:04:49 -08:00
d0b8a125f5 integration-cli: remove not necessary -d
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: faf4604dac41b4fdb88b3e6552d24d5ea5e3f16c
Component: engine
2016-02-27 18:27:25 +01:00
9b7901fe87 Merge pull request #20742 from cpuguy83/revert_aufs_fine_locks
Revert aufs fine locks
Upstream-commit: c7d6f0c30c824e27f3bf4dd846a68b04544d5a15
Component: engine
2016-02-27 08:53:04 -08:00
97a39565a4 Merge pull request #20734 from cpuguy83/fix_flakey_test
Fix flakey TestStatsAllNewContainersAdded
Upstream-commit: c24d4e8ab4a477eaaa90716e87a076bc6fc6f49c
Component: engine
2016-02-27 07:52:18 -08:00
a63e28ad6f fix double-lock
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: e386dfc33fc1fd5ed06496bd19f01a37c3c46341
Component: engine
2016-02-27 09:49:21 -05:00
3dc80838d5 Merge pull request #20739 from LK4D4/keys_config
Add CONFIG_KEYS to check-config.sh
Upstream-commit: 3f4e49aa618800396da87784211e4e02c5509551
Component: engine
2016-02-27 14:33:54 +01:00
f76950a71a Revert "Add finer-grained locking for aufs"
This reverts commit f31014197cbe9438cc956ed12c47093a0324c82d.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: c2f7777603039b0e9b7e8fcdf517b1486dc14781
Component: engine
2016-02-27 08:01:19 -05:00
8b2b861995 Add CONFIG_KEYS to check-config.sh
We need this after opencontainers/runc#488

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c1996c92455718e65a6211183e244a1e0ff803fe
Component: engine
2016-02-26 23:40:35 -08:00
345f6f4c72 Changed the Remote API reference to connect a container to a network in v1.22
and v1.23

Signed-off-by: Christian Böhme <development@boehme3d.de>
Upstream-commit: 2bd365ae2f9c80aa03db30c817ced6ee1d80aa45
Component: engine
2016-02-27 01:31:03 +01:00
8135f8d68c Merge pull request #20699 from calavera/remove_static_error_declarations
Remove static errors from errors package.
Upstream-commit: df2b74188ec51422e84ec1dbdc58abf08c215019
Component: engine
2016-02-26 16:30:12 -08:00
a36a788004 Merge pull request #20672 from justincormack/personality
Add some uses of personality syscall to default seccomp filter
Upstream-commit: f666d918fca8ad82423443b0f01528b94990b0bc
Component: engine
2016-02-26 14:27:23 -08:00
e827c116e4 Merge pull request #20636 from anusha-ragunathan/apt-ftparchive
Always create apt-ftparchive.conf.
Upstream-commit: 5bfaab984c94665ff6be80aefc434efc50c07667
Component: engine
2016-02-26 14:12:06 -08:00
f2e59b69d5 Fix flakey TestStatsAllNewContainersAdded
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: efd281d6ebfe4e6a493d00382f3891ee0e90b02e
Component: engine
2016-02-26 16:52:36 -05:00
84d241709b Make stdcopy.stdWriter goroutine safe.
Stop using global variables as prefixes to inject the writer header.
That can cause issues when two writers set the length of the buffer in
the same header concurrently.

Stop Writing to the internal buffer twice for each write. This could
mess up with the ordering information is written.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: 443a5c20216b5331b1bb57796140c0178ca44b7d
Component: engine
2016-02-26 16:51:18 -05:00
7c97092faa Merge pull request #20275 from cpuguy83/finer_graph_locks
Finer graph locks
Upstream-commit: 2f797bb1d9826f1aba242965b611b71b81fd152e
Component: engine
2016-02-26 13:33:34 -08:00
e0b6d7e1f3 Merge pull request #20729 from estesp/pipework
Add synchronization and closure to IO pipes in userns path
Upstream-commit: 51302c29edf256276ba4ba9a20076866db522f66
Component: engine
2016-02-26 13:33:02 -08:00
b2ac99b3fa Remove static errors from errors package.
Moving all strings to the errors package wasn't a good idea after all.

Our custom implementation of Go errors predates everything that's nice
and good about working with errors in Go. Take as an example what we
have to do to get an error message:

```go
func GetErrorMessage(err error) string {
	switch err.(type) {
	case errcode.Error:
		e, _ := err.(errcode.Error)
		return e.Message

	case errcode.ErrorCode:
		ec, _ := err.(errcode.ErrorCode)
		return ec.Message()

	default:
		return err.Error()
	}
}
```

This goes against every good practice for Go development. The language already provides a simple, intuitive and standard way to get error messages, that is calling the `Error()` method from an error. Reinventing the error interface is a mistake.

Our custom implementation also makes very hard to reason about errors, another nice thing about Go. I found several (>10) error declarations that we don't use anywhere. This is a clear sign about how little we know about the errors we return. I also found several error usages where the number of arguments was different than the parameters declared in the error, another clear example of how difficult is to reason about errors.

Moreover, our custom implementation didn't really make easier for people to return custom HTTP status code depending on the errors. Again, it's hard to reason about when to set custom codes and how. Take an example what we have to do to extract the message and status code from an error before returning a response from the API:

```go
	switch err.(type) {
	case errcode.ErrorCode:
		daError, _ := err.(errcode.ErrorCode)
		statusCode = daError.Descriptor().HTTPStatusCode
		errMsg = daError.Message()

	case errcode.Error:
		// For reference, if you're looking for a particular error
		// then you can do something like :
		//   import ( derr "github.com/docker/docker/errors" )
		//   if daError.ErrorCode() == derr.ErrorCodeNoSuchContainer { ... }

		daError, _ := err.(errcode.Error)
		statusCode = daError.ErrorCode().Descriptor().HTTPStatusCode
		errMsg = daError.Message

	default:
		// This part of will be removed once we've
		// converted everything over to use the errcode package

		// FIXME: this is brittle and should not be necessary.
		// If we need to differentiate between different possible error types,
		// we should create appropriate error types with clearly defined meaning
		errStr := strings.ToLower(err.Error())
		for keyword, status := range map[string]int{
			"not found":             http.StatusNotFound,
			"no such":               http.StatusNotFound,
			"bad parameter":         http.StatusBadRequest,
			"conflict":              http.StatusConflict,
			"impossible":            http.StatusNotAcceptable,
			"wrong login/password":  http.StatusUnauthorized,
			"hasn't been activated": http.StatusForbidden,
		} {
			if strings.Contains(errStr, keyword) {
				statusCode = status
				break
			}
		}
	}
```

You can notice two things in that code:

1. We have to explain how errors work, because our implementation goes against how easy to use Go errors are.
2. At no moment we arrived to remove that `switch` statement that was the original reason to use our custom implementation.

This change removes all our status errors from the errors package and puts them back in their specific contexts.
IT puts the messages back with their contexts. That way, we know right away when errors used and how to generate their messages.
It uses custom interfaces to reason about errors. Errors that need to response with a custom status code MUST implementent this simple interface:

```go
type errorWithStatus interface {
	HTTPErrorStatusCode() int
}
```

This interface is very straightforward to implement. It also preserves Go errors real behavior, getting the message is as simple as using the `Error()` method.

I included helper functions to generate errors that use custom status code in `errors/errors.go`.

By doing this, we remove the hard dependency we have eeverywhere to our custom errors package. Yes, you can use it as a helper to generate error, but it's still very easy to generate errors without it.

Please, read this fantastic blog post about errors in Go: http://dave.cheney.net/2014/12/24/inspecting-errors

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: a793564b2591035aec5412fbcbcccf220c773a4c
Component: engine
2016-02-26 15:49:09 -05:00
7b1eb1255a Merge pull request #20725 from runcom/fix-subid-files-parsing
pkg: idtools: fix subid files parsing
Upstream-commit: b2a15a222626be8b70820a37c910614387b43575
Component: engine
2016-02-26 21:28:08 +01:00
5e9f05d546 Add synchronization and closure to IO pipes in userns path
The execdriver pipes setup uses OS pipes with fds so that they can be
chown'ed to the remapped root user for proper access. Recent flakiness
in certain short-lived tests (usually via the "exec" path) reveals that
the copy routines are not completing before exit/tear-down.

This fix adds synchronization and proper closure such that these
routines exit successfully.

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 995386735c2fe47ebb144f95adbc8eb1341ac48b
Component: engine
2016-02-26 13:47:34 -05:00
3edfa94729 Add some uses of personality syscall to default seccomp filter
We generally want to filter the personality(2) syscall, as it
allows disabling ASLR, and turning on some poorly supported
emulations that have been the target of CVEs. However the use
cases for reading the current value, setting the default
PER_LINUX personality, and setting PER_LINUX32 for 32 bit
emulation are fine.

See issue #20634

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
Upstream-commit: 39b799ac53e2ba397edc3063432d01478416dbc8
Component: engine
2016-02-26 18:43:08 +01:00
be189c5bc1 Merge pull request #20703 from riyazdf/notary-v0.2.0-vendor
Vendor in notary v0.2.0
Upstream-commit: e330d0749ce2d137249f290a4d20b0997279dbec
Component: engine
2016-02-26 08:53:07 -08:00
03ce1316a5 Merge pull request #20428 from jfrazelle/generate-conversion
generate seccomp profile convert type
Upstream-commit: c47674efda39226e7323e5668ee279927997fb4f
Component: engine
2016-02-26 10:28:23 -05:00
8491fb072b pkg: idtools: fix subid files parsing
Since Docker is already skipping newlines in /etc/sub{uid,gid},
this patch skips commented out lines - otherwise Docker fails to start.
Add unit test also.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: bf04d68db2b808a40fa24ac2bfa86c8af22d5f11
Component: engine
2016-02-26 15:42:05 +01:00
ae16b13956 Merge pull request #20515 from raesene/patch-1
Update security.md with basic User Namespace info.
Upstream-commit: 9792308b840c017f5772cee026f9537b2efe33f1
Component: engine
2016-02-26 14:02:46 +01:00
c8f762798b Merge pull request #20722 from thaJeztah/remove-vivid-reference
remove leftover Ubuntu 15.04 from install docs
Upstream-commit: d622494c3b5a9c1fffa1a9018104d20cea52644b
Component: engine
2016-02-26 13:59:36 +01:00
7adb67365b remove leftover Ubuntu 15.04 from install docs
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 1ca064cb62a88366bc13af67a112aff8992b6b68
Component: engine
2016-02-26 13:00:27 +01:00
2099e9bf10 bumping miekg/pkcs11 dependency for go1.6
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 0bb1acee3778009d775b81525f64796d9ea62a21
Component: engine
2016-02-25 21:29:37 -08:00
5bfa2d9a1f Merge pull request #20655 from hqhq/hq_fix_update_memoryswap
Fix problems when update swap memory
Upstream-commit: 6748cc10ac280950103d88a249f7d443715cf833
Component: engine
2016-02-25 22:28:53 -05:00
623b2b65cf Merge pull request #20263 from Microsoft/jjh/testunit-fileutils
Windows CI: Fixes panic in test-unit for FileUtils
Upstream-commit: 6c35350baba816f99bd8236b4b463bbb8d61e25d
Component: engine
2016-02-25 17:35:32 -08:00
8f26d8491f Merge pull request #20481 from HackToday/addcheckfd
Add check for non-systemd fd use case
Upstream-commit: dd53ab14e4adb3d54fbd102dcce6bc476e5b3310
Component: engine
2016-02-25 16:38:53 -08:00