Commit graph

1674 commits

Author SHA1 Message Date
Richard Scothern
36936218c2 Enable proxying registries to downgrade fetched manifests to Schema 1.
Ensure Accept headers are sent with TagService.Get (which hits manifest
endpoints).  Add support for remote Get and Put for the proxied blobstore.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-02-23 14:39:19 -08:00
Richard Scothern
16445b6767 Extend authChallenger interface to remove type cast.
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-02-23 14:39:14 -08:00
Richard Scothern
740ed699f4 To avoid any network use unless necessary, delay establishing authorization
challenges with the upstream until any proxied data is found not to be local.

Implement auth challenges behind an interface and add to unit tests.  Also,
remove a non-sensical unit test.

Signed-off-by: Richard Scothern <richard.scothern@docker.com>
2016-02-23 14:39:06 -08:00
Derek McGowan
d1c173078f Add option to disable signatures
Add option for specifying trust key for signing schema1 manifests.
Since schema1 signature key identifiers are not verified anywhere and deprecated, storing signatures is no longer a requirement.
Furthermore in schema2 there is no signature, requiring the registry to already add signatures to generated schema1 manifests.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-02-23 14:38:49 -08:00
Derek McGowan
d7eb5d118a Fix schema1 manifest etag and docker content digest header
When schema2 manifests are rewritten as schema1 currently the etag and docker content digest header keep the value for the schema2 manifest.

Fixes #1444

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2016-02-23 14:36:36 -08:00
Aaron Lehmann
34c3acf8a8 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-23 14:35:57 -08:00
Richard Scothern
0996228761 Update maintainers and authors
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-02-04 11:11:33 -08:00
Richard Scothern
cd28f16906 update version file
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-02-04 11:10:07 -08:00
Richard Scothern
d793822290 Merge pull request #1394 from RichardScothern/invalidate-bdc
Invalidate the blob store descriptor cache
2016-01-28 10:04:09 -08:00
Richard Scothern
a8861549cf Invalidate the blob store descriptor caches when content is removed from from
the proxy.  Also, switch to reference in the scheduler API.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-01-26 17:02:59 -08:00
Richard Scothern
584c9b517c Correct test digest lengths and enable all unit tests
Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
2016-01-26 17:02:46 -08:00
Richard Scothern
69db5b7440 Merge pull request #1333 from aaronlehmann/use-reference-package
Use reference package
2016-01-22 15:54:19 -08:00
Aaron Lehmann
2b20b0167a Change URLBuilder methods to use references for tags and digests
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-22 14:49:29 -08:00
Aaron Lehmann
4441333912 Use reference package internally
Most places in the registry were using string types to refer to
repository names. This changes them to use reference.Named, so the type
system can enforce validation of the naming rules.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-01-22 14:47:05 -08:00
Olivier Gambier
caa2001e1f Merge pull request #1341 from moxiegirl/fix-issue-1254
Pulling driver specs out of configuruation.md
2016-01-21 16:57:23 -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
Mary Anthony
cab284d6b2 - Pulling driver specs out of configuruation.md
- Fixing index metadata error
- Entering all the comments
- Updating with the build fixes
- Fix Microsoft link broken
- Fix collocate, colocate, to unambiguous co-locate

Signed-off-by: Mary Anthony <mary@docker.com>
2016-01-21 10:12:46 -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