Commit Graph

2929 Commits

Author SHA1 Message Date
afc4d63ffe Merge pull request #20565 from kencochrane/remove_email_on_login
Remove email address field from login
Upstream-commit: 2453262e7ba131fede74dbf31df41da9d2f36c34
Component: engine
2016-03-01 08:02:16 -08:00
2919d69a0c Remove email address field from login
This removes the email prompt when you use docker login, and also removes the ability to register via the docker cli. Docker login, will strictly be used for logging into a registry server.

Signed-off-by: Ken Cochrane <kencochrane@gmail.com>
Upstream-commit: aee260d4eb3aa0fc86ee5038010b7bbc24512ae5
Component: engine
2016-02-29 17:53:27 -08:00
6a88816da7 Merge pull request #20782 from estesp/new-parent-dir-ownership
Fix ownership of non-existing parent dir
Upstream-commit: 67b16c73818726d9818d0229fa6cdda3e5f698b0
Component: engine
2016-03-01 01:45:38 +01:00
2180969e3a Merge pull request #20107 from calavera/client_auth_store
Client credentials store.
Upstream-commit: 29ce086e38384c54f6f2d8f09578a75c4c9d9593
Component: engine
2016-02-29 22:31:34 +01:00
60a83559ef Merge pull request #20692 from coolljt0725/add_brnf_test_request
Add bridgeNfIptables and bridgeNfIp6tables test request
Upstream-commit: ea6d2708e2f115b9637ee11521f5f570b2819808
Component: engine
2016-02-29 15:16:27 -05:00
e32705bbc7 Merge pull request #20480 from wenchma/20431-filter_since_before
Enhancement of docker ps before and since filters
Upstream-commit: 9eb4575f8cdb8f9afb0d53d6fd4a34b077cc08da
Component: engine
2016-02-29 20:57:43 +01:00
70ddfe143d Merge pull request #20749 from mountkin/validate-log-opts
validate log-opt when creating containers
Upstream-commit: 2391794d2695079f2dd19b10cd51aea6922b3ec9
Component: engine
2016-02-29 13:47:25 -05:00
8a7585ce8e Client credentials store.
This change implements communication with an external credentials store,
ala git-credential-helper. The client falls back the plain text store,
what we're currently using, if there is no remote store configured.

It shells out to helper program when a credential store is
configured. Those programs can be implemented with any language as long as they
follow the convention to pass arguments and information.

There is an implementation for the OS X keychain in https://github.com/calavera/docker-credential-helpers.
That package also provides basic structure to create other helpers.

Signed-off-by: David Calavera <david.calavera@gmail.com>
Upstream-commit: cf721c23e715e545eccf8484e145c2d18d6a6a23
Component: engine
2016-02-29 13:01:31 -05:00
66f153da0f Merge pull request #20774 from hqhq/hq_vender_engine_api
Vendor engine-api to 70d266e96080e3c3d63c55a4d8659e00ac1f7e6c
Upstream-commit: b211e57f23848bd1990db84d2ccce0ce529e735a
Component: engine
2016-02-29 18:48:55 +01:00
848fd14888 Fix ownership of non-existing parent dir
During "COPY" or other tar unpack operations, a target/destination
parent dir might not exist and should be created with ownership of the
root in the right context (including remapped root when user namespaces
are enabled)

Docker-DCO-1.1-Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com> (github: estesp)
Upstream-commit: 7a61b9ae425e5c100da2bb32b929031c6302b3fb
Component: engine
2016-02-29 09:14:23 -05:00
98394b0b6e Vendor engine-api to 70d266e96080e3c3d63c55a4d8659e00ac1f7e6c
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 53b0d62683ee798198c553353dc2106623a9259b
Component: engine
2016-02-29 19:28:37 +08: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
c3440ba69f validate log-opt when creating containers
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
Upstream-commit: 7285c9a53a6a661e7ded4637d937f9d20dcf46c0
Component: engine
2016-02-28 01:51:46 +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
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
f7369d4578 Add bridgeNfIptables and bridgeNfIp6tables test request
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 79843b727fca8502d5463851a1238708240622d8
Component: engine
2016-02-26 19:53:35 -05: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
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
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
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
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
eadd157313 Merge pull request #20580 from BrianBland/crossRepoPushRetry
Improve auth fallback behavior for cross-repository push
Upstream-commit: d8b6e62f50c1ca40903b89a789b0a1806013a5b8
Component: engine
2016-02-25 16:37:04 -08:00
2bc21a41ec Merge pull request #20673 from Microsoft/jjh/testkill
Windows CI: Port TestKill*
Upstream-commit: 5cb4693300114436ac62697b0dff35c0f5bce9aa
Component: engine
2016-02-26 01:11:51 +01:00
534b2f0779 Vendor in notary v0.2.0
Signed-off-by: Riyaz Faizullabhoy <riyaz.faizullabhoy@docker.com>
Upstream-commit: 84dc2d9e70f1ad4422732421e2d6b91274f4dfae
Component: engine
2016-02-25 13:40:00 -08:00
aa1fcfa3ec Merge pull request #20697 from tiborvass/tls-remote-daemon-tests
Support TLS remote test daemon
Upstream-commit: 6fa5576e308d4c99e9a818f924483536a773afba
Component: engine
2016-02-25 16:16:40 -05:00
cfd2e7e48d Support TLS remote test daemon
This will allow us to have a windows-to-linux CI, where the linux host
can be anywhere, connecting with TLS.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: f4a1e3db998816e5fcb0df56c29519c488890464
Component: engine
2016-02-25 14:12:17 -05:00
1f47465496 Fix TestExecApiStartWithDetach on WindowsTP4
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 21c85111231caeb6d2d342f13999d706cc33ff6a
Component: engine
2016-02-25 14:27:22 +01:00
5cbdc71804 Merge pull request #20679 from Microsoft/jjh/testrestart
Windows CI: Port docker_cli_restart_test.go
Upstream-commit: 7cf03700f891f0863f11ee57c2d3f8d68350d91b
Component: engine
2016-02-25 10:17:25 +01:00
a59cde77dc Enhancement of docker ps before and since filters
This enhancement is to fix the wrong list results on
`docker ps` before and since filters specifying the non-running container.

Fixes issue #20431

Signed-off-by: Wen Cheng Ma <wenchma@cn.ibm.com>
Upstream-commit: bc72883fe13b5cc39235b4996064bea7a5528ebf
Component: engine
2016-02-25 16:58:31 +08:00
6395a43374 Merge pull request #20677 from Microsoft/jjh/testclilogs
Windows CI: Port docker_cli_logs_test.go
Upstream-commit: ca7ce05e819959def59f8e3c07fdf03cbdcc0770
Component: engine
2016-02-25 09:38:23 +01:00
81c0ade270 Merge pull request #20682 from cpuguy83/fix_volplugin_panics
Fix panic when plugin responds with null volume
Upstream-commit: 0ad04242b4a7f98b691573f9095330ba9e74ae3b
Component: engine
2016-02-25 09:32:54 +01:00
bd2ade864c Merge pull request #20674 from Microsoft/jjh/testlogsapi
Windows CI: Port TestLogsAPI*
Upstream-commit: 9f1ad7850c03f75f9e69a8f3f76290533363ea7a
Component: engine
2016-02-25 09:11:15 +01:00
ca8a5e468f Merge pull request #20664 from Microsoft/jjh/busyboxtop
Windows CI: Integrity check for busybox top
Upstream-commit: abfc480f4be9a62c16e6af26160de8b80c805e51
Component: engine
2016-02-25 09:09:37 +01:00
b417dc79d3 Windows CI: Port docker_cli_logs_test.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 10bd587d77eff327cfb0dff2add4688a183c41a3
Component: engine
2016-02-24 20:19:48 -08:00
4d716f809c Merge pull request #20647 from coolljt0725/fix_20638
Fix exec start api with detach and AttachStdin at same time. fixes #2…
Upstream-commit: cee4ff1c4ac0bb47ed847f3bb725fd6233613937
Component: engine
2016-02-24 20:17:15 -08:00
acc7d09962 Improve fallback behavior for cross-repository push
Attempt layer mounts from up to 3 source repositories, possibly
falling back to a standard blob upload for cross repository pushes.
Addresses compatiblity issues with token servers which do not grant
multiple repository scopes, resulting in an authentication failure for
layer mounts, which would otherwise cause the push to terminate with an
error.

Signed-off-by: Brian Bland <brian.bland@docker.com>
Upstream-commit: 1d3480f9ba3525309030497d5c8a3dd5725ed15a
Component: engine
2016-02-24 19:13:35 -08:00
d1a3bc5db1 Fix exec start api with detach and AttachStdin at same time. fixes #20638
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: fb0ac1afd97e6e3bf3c13dcda5821f36b56cc62b
Component: engine
2016-02-24 21:04:44 -05:00
661cc031a6 Fix panic when plugin responds with null volume
In cases where the a plugin responds with both a null or empty volume
and a null or empty Err, the daemon would panic.
This is because we assumed the idiom if `err` is nil, then `v` must not
be but in reality the plugin may return whatever it wants and we want to
make sure it doesn't harm the daemon.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 96c79a1934dd52d2a6f648e519b5d4ac60ac8ca1
Component: engine
2016-02-24 20:45:38 -05:00
e682d2e8d7 Windows CI: Port docker_cli_restart_test.go
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 281c1ced6d6901ffb7faee209c243d0734abc792
Component: engine
2016-02-24 15:21:56 -08:00
dc55874ee6 Windows CI: Port TestLogsAPI*
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 00f65ae810679d587cb52466f52988ae9267e91d
Component: engine
2016-02-24 13:43:52 -08:00
d4cddca903 Windows CI: Port TestKill*
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 03e2ff322b064504f5c22bd5fbe863ae1c4bf0fc
Component: engine
2016-02-24 13:33:25 -08:00
4dd0ef305c Windows CI: Integrity check for busybox top
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 6a931c3590f5a2f274f9ab4c43452939d101a1b5
Component: engine
2016-02-24 11:00:47 -08:00
148812de36 Merge pull request #20637 from Microsoft/jjh/fixteststartattachmultiplecontainers
Windows CI: Fix TestStartAttachMultipleContainers
Upstream-commit: 467c8b1a6a866081081a90ea9cec94640638781a
Component: engine
2016-02-24 08:46:00 -08:00
8075c13623 Merge pull request #20619 from Microsoft/jjh/useraccounts
Windows: Updates for virtual user account
Upstream-commit: 5fdfb2985b209660a1a540222f614b73a0dc2e63
Component: engine
2016-02-24 13:48:27 +01:00
34876f5fef Merge pull request #20017 from calavera/expose_volumes_in_ps
Add mounts to docker ps.
Upstream-commit: 034a1a8dfd17d89123bf0405f898e880575ed775
Component: engine
2016-02-24 11:08:21 +01:00
1fba362e2f Restore container configs when update failed
Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: fa3b1971578b3e270417df0215eeacaa03e881cf
Component: engine
2016-02-24 14:23:48 +08:00
da2ba30b2d Support update swap memory only
We should support update swap memory without memory.

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Upstream-commit: 8ae6f6ac28c1e9e28c1503b8118691580b66d885
Component: engine
2016-02-24 13:36:47 +08:00
ca915e8020 Windows CI: Fix TestStartAttachMultipleContainers
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: ef9f13af3d9293458a03223a030028381da4ae09
Component: engine
2016-02-23 16:24:35 -08:00