Commit graph

4700 commits

Author SHA1 Message Date
Stephen J Day
0818476cb1 Open up v2 http status code checks for put and head checks
Under certain cases, such as when putting a manifest or check for the existence
of a layer, the status code checks in session_v2.go were too narrow for their
purpose. In the case of putting a manifest, the handler only cares that an
error is not returned. Whether it is a 304 or 202 does not matter, as long as
the server reports success. Having the client only accept specific http codes
inhibits future protocol evolution.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-27 18:09:53 -08:00
Stephen Day
1650088629 Merge pull request #77 from ahmetalpbalkan/TestStatCall-fix
Allow modtime to be a few seconds off on TestStatCall
2015-01-27 17:07:28 -08:00
Ahmet Alp Balkan
51042da7fb Modify TestStatCall to check if ModTime is increasing
Also removed ModTime checks on directories as it is not
required and some drivers might fail to provide it.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-01-27 14:28:43 -08:00
Olivier Gambier
769df8dabe Merge pull request #109 from AndreyKostov/storagedriver-s3-rotating-buffer
Add a rotating buffer functionality to the s3 driver
2015-01-27 14:27:24 -08:00
Stephen Day
fd37df55ff Merge pull request #111 from ahmetalpbalkan/inmemory-fix
update modtime on WriteAt for inmemory driver
2015-01-27 14:26:14 -08:00
Ahmet Alp Balkan
bf49cad662 Update modtime on WriteAt for inmemory driver
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-01-27 14:05:36 -08:00
Andrey Kostov
c05e4682f8 Add a rotating buffer functionality to the s3 driver 2015-01-27 13:24:17 -08:00
Jessie Frazelle
b7db855fc6 Merge pull request #10249 from jlhawn/distribution_version_header_10247
Split API Version header when checking for v2
2015-01-27 11:48:42 -08:00
Olivier Gambier
f0e0a080e9 Merge pull request #108 from AndreyKostov/storagedriver-check-writestream-overwrite
Make TestContinueStreamAppend check if WriteStream can overwrite
2015-01-26 14:01:23 -08:00
Derek McGowan
d96d4aa9f0 Better error messaging and logging for v2 registry requests
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-26 14:00:51 -08:00
Andrey Kostov
a5b5ef99a0 Make TestContinueStreamAppend check if WriteStream can overwrite
Also split the test into a small and large version.
2015-01-26 13:50:45 -08:00
Stephen Day
a1547ab751 Merge pull request #75 from ahmetalpbalkan/large-stream
Modify TestWriteReadLargeStreams to write in one shot
2015-01-26 11:37:51 -08:00
Olivier Gambier
e0c6f03c11 Merge pull request #105 from AndreyKostov/storagedriver-s3-add-chunksize-param
Add the chunksize parameter
2015-01-23 17:41:52 -08:00
Andrey Kostov
8341f0ce5d Add the chunksize parameter
Also change default chunkSize to 10MB (up from 5).
2015-01-23 17:28:09 -08:00
Stephen Day
3dc95e213c Merge pull request #104 from AndreyKostov/storagedriver-s3-fix-iam-role-bug
Fixes an IAM role authentication bug
2015-01-23 16:03:21 -08:00
Andrey Kostov
34f86b9ad6 Fixes an IAM role authentication bug
More specifically, the driver panics if initialized with
FromParameters with empty accesskey or secretkey.
2015-01-23 15:50:55 -08:00
Stephen Day
75c1b2bae7 Merge pull request #91 from tianon/dockerfile-godeps
Update the Dockerfile to use the Godeps versions of libraries and to explicitly use golang:1.4
2015-01-22 16:11:46 -08:00
Stephen Day
bd0d90396b Merge pull request #98 from docker/circle-godep
Move to circle.yml to godep
2015-01-22 16:11:02 -08:00
Olivier Gambier
49357a5d59 Move to godep 2015-01-22 15:52:46 -08:00
Stephen Day
6b3bfa724d Merge pull request #90 from stevvooe/registry-decorator
Implement registry decorator toolkit
2015-01-22 15:08:13 -08:00
Stephen Day
686da01dd7 Merge pull request #93 from BrianBland/config-test
Adds test for extraneous configuration environment variables
2015-01-21 15:40:14 -08:00
Derek McGowan
41703e2bb7 Fix write after close on http response
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-21 15:14:01 -08:00
Josh Hawn
6a736c20f0 Split API Version header when checking for v2
Since the Docker-Distribution-API-Version header value may contain multiple
space delimited versions as well as many instances of the header key, the
header value is now split on whitespace characters to iterate over all versions
that may be listed in one instance of the header.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-01-21 15:08:32 -08:00
Brian Bland
a35f1d04fe Adds test for extraneous configuration environment variables
Signed-off-by: Brian Bland <brian.bland@docker.com>
2015-01-21 12:02:51 -08:00
Stephen J Day
3911880491 Implement registry decorator toolkit
This change provides a toolkit for intercepting registry calls, such as
`ManifestService.Get` and `LayerUpload.Finish`, with the goal of easily
supporting interesting callbacks and listeners. The package proxies
returned objects through the decorate function before creation, allowing one to
carefully choose injection points.

Use cases range from notification systems all the way to cache integration.
While such a tool isn't strictly necessary, it reduces the amount of code
required to accomplish such tasks, deferring the tricky aspects to the
decorator package.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-21 10:46:20 -08:00
Tibor Vass
b2830a0786 Merge pull request #10227 from jlhawn/v1_v2_login_patch
Resolve ambiguity on registry v2 ping
2015-01-21 02:10:32 -05:00
Josh Hawn
1c7271129b Resolve ambiguity on registry v2 ping
v2 ping now checks for a Docker-Distribution-API-Version
header that identifies the endpoint as "registry/2.0"

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-01-20 19:52:08 -08:00
Tianon Gravi
037a8a11e8 Update the Dockerfile to use the Godeps versions of libraries and to explicitly use golang:1.4
This speeds up the build (and makes it more consistent) since it doesn't have to clone a bunch of repos. 👍

Signed-off-by: Andrew "Tianon" Page <admwiggin@gmail.com>
2015-01-20 20:08:44 -07:00
Stephen Day
cd647beb1d Merge pull request #89 from jlhawn/version_header
Add Docker Distribution API Version header
2015-01-20 13:42:12 -08:00
Stephen Day
c448e04169 Merge pull request #89 from jlhawn/version_header
Add Docker Distribution API Version header
2015-01-20 13:42:12 -08:00
Josh Hawn
acfcc955de Add Docker Distribution API Version header
Setting a header for all responses can help clients better determine
if the server speaks the legacy v1 API or the v2 API. It is important
that the header be set *BEFORE* routing the request.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-01-20 13:26:05 -08:00
Josh Hawn
c4b2249cb2 Add Docker Distribution API Version header
Setting a header for all responses can help clients better determine
if the server speaks the legacy v1 API or the v2 API. It is important
that the header be set *BEFORE* routing the request.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-01-20 13:26:05 -08:00
Olivier Gambier
8ae6179711 Merge pull request #74 from stevvooe/refactor-storage-interfaces
Refactor storage API to be registry oriented
2015-01-20 10:44:56 -08:00
Stephen Day
4dcc892bf2 Merge pull request #81 from AndreyKostov/storagedriver-s3-fix-param
Fix regionName parameter so as to not have a panic when it is not a string
2015-01-19 15:29:36 -08:00
Andrey Kostov
671c69e0df Fix regionName parameter so as to not have a panic when it is not a string 2015-01-19 14:23:28 -08:00
Jessie Frazelle
35bb812cee Merge pull request #9784 from dmcgowan/v2-registry
Client Support for Docker Registry HTTP API V2
2015-01-19 10:46:38 -08:00
Ahmet Alp Balkan
7f200f886a Add TestPutContentMultipleTimes to storage driver suite
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-01-18 00:29:12 -08:00
Ahmet Alp Balkan
9981318d75 modify TestWriteReadLargeStreams to write in one shot 2015-01-17 17:11:12 -08:00
Jessie Frazelle
693c9d4120 Merge pull request #10143 from cpuguy83/10129_marshal-indent_dockercfg
Make .dockercfg with json.MarshallIndent
2015-01-17 14:18:45 -08:00
Brian Goff
4eaf644321 Make .dockercfg with json.MarshallIndent
Fixes #10129
Makes the .dockercfg more human parsable.

Also cleaned up the (technically) racey login test.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-01-17 07:05:56 -05:00
Stephen J Day
825da388a4 Update the registry app to use the new storage interfaces
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-16 18:33:28 -08:00
Stephen J Day
ff4a1700cc Update the registry app to use the new storage interfaces
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-16 18:33:28 -08:00
Stephen J Day
ea5b999fc0 Refactor storage API to be registry oriented
In support of making the storage API ready for supporting notifications and
mirroring, we've begun the process of paring down the storage model. The
process started by creating a central Registry interface. From there, the
common name argument on the LayerService and ManifestService was factored into
a Repository interface. The rest of the changes directly follow from this.

An interface wishlist was added, suggesting a direction to take the registry
package that should support the distribution project's future goals. As these
objects move out of the storage package and we implement a Registry backed by
the http client, these design choices will start getting validation.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2015-01-16 18:33:21 -08:00
Stephen Day
03406ab708 Merge pull request #73 from BrianBland/godeps
Updates Godeps to a compiling/stable state
2015-01-16 14:05:16 -08:00
Brian Bland
e1ab3443db Updates Godeps to a compiling/stable state
Includes newer docker/libtrust and crowdmob/goamz
2015-01-16 13:56:37 -08:00
Stephen Day
81ea264dea Merge pull request #70 from BrianBland/go-yaml-dep
Remove dependency on BrianBland/yaml fork
2015-01-16 13:55:55 -08:00
Brian Bland
24155c0431 Remove dependency on BrianBland/yaml fork
Switched back to only using the go-yaml/yaml mainline repo.
Fixes #69
2015-01-16 11:36:25 -08:00
Stephen Day
10c9dfb5a6 Merge pull request #67 from BrianBland/layerhandler-http-method
Forwards http method to the layerhandler for layer serving
2015-01-16 10:54:20 -08:00
Brian Bland
bd9f3702f7 DelegateLayerHandler now uses http method in url generation 2015-01-15 18:15:26 -08:00
Derek McGowan
9c24fc93ad Add token cache
Token cache prevents the need to get a new token for every registry interaction.
Since the tokens are short lived, the cache expires after only a minute.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
2015-01-15 14:05:06 -08:00