Commit Graph

1659 Commits

Author SHA1 Message Date
Aaron Lehmann 0f2d99b13a Allow uppercase characters in hostnames
This allows hostnames to contain uppercase characters, matching behavior
in Docker versions before 1.10. It does not attempt to canonicalize
hostnames into a lowercase format before parsing, since this could lead
to corner cases (for example, making Hostname.Domain.Com/ref ambiguous
on a daemon which contains references for both hostname.domain.com/ref
and Hostname.Domain.Com/ref).

Fixes: #1433

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-02-08 10:56:31 -08:00
Richard Scothern c301f8ab27 Merge pull request #1383 from aaronlehmann/default-manifest-type
If the media type for a manifest is unrecognized, default to schema1
2016-01-21 10:59:19 -08:00
Richard Scothern 70f4dac7f7 Merge pull request #1376 from aaronlehmann/use-mime-pkg
Use mime package to parse media type
2016-01-21 10:58:53 -08:00
Richard Scothern 1df70eb1da Merge pull request #1377 from RichardScothern/correct-event-digest
Ensure the canonical manifest digest and length are sent to notification endpoints.
2016-01-21 09:34:56 -08:00
Aaron Lehmann c01fe47231 If the media type for a manifest is unrecognized, default to schema1
This is needed for compatibility with some third-party registries that
send an inappropriate Content-Type header such as text/html.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-21 09:34:06 -08:00
Stephen Day 08650825fe Merge pull request #1380 from aaronlehmann/avoid-empty-accept-header
Avoid empty Accept headers in client requests
2016-01-20 15:38:07 -08:00
Aaron Lehmann acf02bead3 Avoid empty Accept headers in client requests
One of the keys in the manifest media type map is an empty string. This
should not be sent as an Accept header.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-20 15:22:38 -08:00
Stephen Day 182bddcf11 Merge pull request #1379 from aaronlehmann/token-error
Handle nonstandard token endpoint errors
2016-01-20 15:07:47 -08:00
Aaron Lehmann ec636bbfd2 Handle nonstandard token endpoint errors
https://github.com/docker/distribution/pull/1249 changed token fetching
to parse HTTP error response bodies as serialized errcodes. However,
Docker Hub's authentication endpoint does not return error bodies in
this format. To work around this, convert its format into
ErrCodeUnauthorized or ErrCodeUnknown.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-20 14:45:08 -08:00
Richard Scothern dd0d5a31f5 Merge pull request #1378 from stevvooe/update-specification-changelog
spec/api: add missing entries to changelog
2016-01-20 13:09:44 -08:00
Richard Scothern fdd2e4d77e Merge pull request #1372 from aibaars/gcs-delete
StorageDriver GCS: improve test suite clean-up and add retrying to all GCS api calls
2016-01-20 12:21:22 -08:00
Stephen J Day eb87f00afd spec/api: add missing entries to changelog
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2016-01-20 12:19:25 -08:00
Richard Scothern 4f822100f7 Ensure the canonical manifest digest and length are sent to notification endpoints.
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-01-20 11:21:04 -08:00
Aaron Lehmann 93d019658f Use mime package to parse media type
This replaces custom parsing with the standard library's mime package.
This is simpler and more correct.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-20 09:59:19 -08:00
Arthur Baars 2a4345ca4b StorageDriver: GCS: retry all api calls
Signed-off-by: Arthur Baars <arthur@semmle.com>
2016-01-20 13:24:09 +00:00
Arthur Baars 6ee339464c StorageDriver: Test suite: improve cleanup
Verify that the file(s) have been deleted after calling Delete,
and retry if this is not the case. Furthermore, report the error
if a Delete operation fails.

Signed-off-by: Arthur Baars <arthur@semmle.com>
2016-01-20 13:24:09 +00:00
Richard Scothern 47a064d419 Merge pull request #1367 from aaronlehmann/signed-manifest-content-type
Fix content type for schema1 signed manifests
2016-01-19 11:00:47 -08:00
Aaron Lehmann 8c1a000799 Fix content type for schema1 signed manifests
The Payload function for schema1 currently returns a signed manifest,
but indicates the content type is that of a manifest that isn't signed.

Note that this breaks compatibility with Registry 2.3 alpha 1 and
Docker 1.10-rc1, because they use the incorrect content type.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-18 16:08:02 -08:00
Richard Scothern 3cb403ae5b Merge pull request #1363 from aaronlehmann/media-type-charset
Do not require "charset=utf-8" for a schema1 with content type application/json
2016-01-18 15:20:01 -08:00
Richard Scothern fc7ee6d789 Merge pull request #1355 from hopkings2008/master
In testsuites.go, enlarge the size of randomBytes to 128M to fix the …
2016-01-18 12:38:26 -08:00
Richard Scothern 775c5fbeba Merge pull request #1354 from RichardScothern/Boran-patch2
Carry #1329 : Fixes so that nginx will start
2016-01-18 11:58:35 -08:00
Sean Boran 07e68b3b04 Carry #1329 : Fixes so that nginx will start
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>

Signed-off-by: Sean Boran <Boran@users.noreply.github.com>
2016-01-18 11:46:39 -08:00
Richard Scothern a1af43d2e0 Merge pull request #1357 from aibaars/gcs-test
StorageDriver GCS test suite: try google.DefaultTokenSource first
2016-01-18 11:29:01 -08:00
Aaron Lehmann 5a2664e0b1 Do not require "charset=utf-8" for a schema1 with content type application/json
For compatibility with other registries that don't use this exact
variant of the Content-Type header, we need to be more flexible about
what we accept. Any form of "application/json" should be allowed. The
charset should not be included in the comparison.

See docker/docker#19400.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-18 09:59:50 -08:00
Arthur Baars 19d7c9e051 StorageDriver GCS: try google.DefaultTokenSource first
Signed-off-by: Arthur Baars <arthur@semmle.com>
2016-01-15 11:47:47 +00:00
yuzou cc82b0d48e In testsuites.go, enlarge the size of randomBytes to 128M to fix the crash of running TestConcurrentStreamReads
Signed-off-by: yuzou <zouyu7@huawei.com>
2016-01-15 17:22:43 +08:00
Richard Scothern 7378e21678 Merge pull request #1332 from RichardScothern/gcs-params
Change the parameters to the GCS drivers to allow CircleCI testing.
2016-01-14 15:50:09 -08:00
Richard Scothern 1cdc683358 Merge pull request #1352 from tpounds/use-go-1.5.3
Use Go 1.5.3
2016-01-14 11:17:54 -08:00
Derek McGowan cb08de17d7 Merge pull request #1351 from BrianBland/splitBlobCreateOptions
Splits up blob create options definitions to be package-specific
2016-01-14 11:10:54 -08:00
Brian Bland 8c5a6c13c0 Splits up blob create options definitions to be package-specific
Redefines privately in both storage and client packages

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-14 10:47:33 -08:00
Trevor Pounds e5ac03f945 Update to Go 1.5.3.
Signed-off-by: Trevor Pounds <trevor.pounds@gmail.com>
2016-01-14 10:40:20 -08:00
Richard Scothern df6cdb7bb6 Merge pull request #1347 from aaronlehmann/go-153
Upgrade CI to go 1.5.3
2016-01-14 10:31:45 -08:00
Brian Bland 2a9849e552 Merge pull request #1348 from BrianBland/fixCrossRepoBlobMount
Fixes cross-repo blob mounting in the BlobUploadHandler
2016-01-14 09:44:30 -08:00
Brian Bland 3ef917c269 Fixes cross-repo blob mounting in the BlobUploadHandler
Accidentally checked for err != nil instead of err == nil :/
Also now ensures that only a non-nil option is appended to the create
options slice

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-13 19:21:45 -08:00
Aaron Lehmann 050fcb7dbb Upgrade CI to go 1.5.3
Go 1.5.0 has some stack pointer bugs. This may have been causing some CI
failures. Upgrade to a newer version.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-13 18:25:20 -08:00
Richard Scothern 81dbebc7d3 Change the parameters to the GCS drivers to allow CircleCI testing.
Remove the requirement of file system access to run GCS unit tests.  Deconstruct
the input parameters to take the private key and email which can be specified on
the build system via environment variables.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-01-13 18:00:59 -08:00
Richard Scothern 5120357906 Merge pull request #1344 from BrianBland/blobCreateWithOptions
Adds functional options arguments to the Blobs Create method, remove Mount operation
2016-01-13 17:35:49 -08:00
Brian Bland ce88d8a6f4 Adds functional options arguments to the Blobs Create method
Removes the Mount operation and instead implements this behavior as part
of Create a From option is provided, which in turn returns a rich
ErrBlobMounted indicating that a blob upload session was not initiated,
but instead the blob was mounted from another repository

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-13 16:42:59 -08:00
Richard Scothern 4378e1aa85 Merge pull request #1345 from BrianBland/fixErrorCodesInAPITemplate
Fixes error codes in the API spec template
2016-01-13 14:55:59 -08:00
Brian Bland ac03070245 Fixes error codes in the API spec template
Uses UPPER_UNDERSCORE_CASE instead of the nice error message format
added in #911

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-13 11:53:40 -08:00
Richard Scothern 39ff320b82 Merge pull request #1335 from RichardScothern/fix-build
Fix manifest API unit tests
2016-01-11 14:17:36 -08:00
Richard Scothern 3ea0d70896 Fix manifest API unit tests
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-01-11 12:52:21 -08:00
Richard Scothern 3a1220de01 Merge pull request #1319 from RichardScothern/update-tags
Remove tags referencing deleted manifests.
2016-01-11 11:33:22 -08:00
Richard Scothern 93d9070c8b Merge pull request #1269 from BrianBland/crossRepositoryPush
Adds cross-repository blob mounting behavior
2016-01-08 14:37:00 -08:00
Brian Bland 613cfc861d Fires a new Mount event when blobs are cross-repo mounted
Adds an optional "fromRepository" field to the event target

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-08 13:53:30 -08:00
Brian Bland 3a35a2d953 Allows token authentication handler to request additional scopes
When an auth request provides the "from" query parameter, the token
handler will add a "pull" scope for the provided repository, refreshing
the token if the overall scope has increased

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-08 13:53:23 -08:00
Brian Bland 5df21570a7 Adds cross-repository blob mounting behavior
Extends blob upload POST endpoint to support mount and from query
parameters as described in #634

Signed-off-by: Brian Bland <brian.bland@docker.com>
2016-01-08 13:53:18 -08:00
Richard Scothern cc0b6b86ea Merge pull request #1276 from denverdino/oss-test
Support large layer for OSS driver
2016-01-08 13:26:09 -08:00
Stephen Day a7ae88da45 Merge pull request #1281 from aaronlehmann/new-manifest
Implement schema2 manifest formats
2016-01-07 17:19:56 -08:00
Stephen Day 5ebf6391a7 Merge pull request #911 from stevvooe/consistent-error-string
More consistent return from ErrorCode.Error()
2016-01-07 17:06:12 -08:00