Commit Graph

286 Commits

Author SHA1 Message Date
f10bd173bd Merge pull request #11478 from dmcgowan/v2-vendored-api
Use v2 api from distribution
Upstream-commit: 563041b5c4acaca8e6ebb8fb4e81a3e7e7c37e81
Component: engine
2015-04-10 17:22:38 -04:00
938f87c2dd Remove engine.Table from docker search and fix missing field
registry/SearchResults was missing the "is_automated" field.
I added it back in.

Pull this 'table' removal one from the others because it fixed
a bug too

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 67b4cce0f6c835cf9e53313a026af2e825ba8b10
Component: engine
2015-04-03 11:27:30 -07:00
753b8ae08c Remove jobs from registry.Service
This makes `registry.Service` a first class type and does not use jobs
to interact with this type.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
Upstream-commit: 03d3d79b2b3f8b720fff2d649aff0ef791cff417
Component: engine
2015-03-31 16:38:04 -07:00
fc0b67bcbc Use vendored v2 registry api
Update registry package to use the v2 registry api from distribution. Update interfaces to directly take in digests.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 62009ef77efcbe30afea0cd124f3fbff0d5030cd
Component: engine
2015-03-31 15:02:27 -07:00
a62098f98e Refactor utils/http.go, fixes #11899
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 0995ab5946b068a14cba05be8b2693c4181097e3
Component: engine
2015-03-30 17:59:57 +02:00
1c9316a817 Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
Upstream-commit: da5c863d20df8c030b3ffc6c4e95f976ed162721
Component: engine
2015-03-26 23:55:50 -07:00
e5b36a723c Replace aliased imports of logrus, fixes #11762
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6f4d847046cb4e072de61d042c0266190d73a8c9
Component: engine
2015-03-26 23:22:04 +01:00
0913f2905d Changed snake case naming to camelCase
Signed-off-by: Peter Choi <phkchoi89@gmail.com>
Upstream-commit: ae907e7af16136225417242ef5d55d3f6062fb3b
Component: engine
2015-03-26 15:05:45 -06:00
04f472f007 Fix for issue 9922: private registry search with auth returns 401
Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: 6b2eeaf8965bac07022752c411b1f8a0f35f9571
Component: engine
2015-03-26 18:59:16 +00:00
a16f3d6cb4 Remove engine.Status and replace it with standard go error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: c79b9bab541673af121d829ebc3b29ff1b01efa2
Component: engine
2015-03-25 22:32:08 +01:00
bca1423917 Add struct tags on v2 remote tags struct
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 4925d98d1f638e9439e19b6c89c608a64a281a39
Component: engine
2015-03-23 14:33:52 -07:00
503249b833 Fix decode tags value error when call get /v2/<name>/tags/list in registry api v2.
Signed-off-by: Meaglith Ma <genedna@gmail.com>
Upstream-commit: 221e9624e3a7a7a9b81ffda9930657352080e32d
Component: engine
2015-03-23 14:33:52 -07:00
4b295342e5 Add check for 404 on get repository data
No longer add the body to the error when a 404 is received on get repository data.

closes #11510

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c8d2ec93caf7c64f3e510e4e75f49614880ed9b9
Component: engine
2015-03-22 18:15:18 -07:00
6df3fa6b80 Merge pull request #11528 from jlhawn/separate_init_blob_upload
Separate init blob upload
Upstream-commit: ca3a912287b6befb5016d358a6b763b0aa72b701
Component: engine
2015-03-20 16:39:31 -07:00
e131073558 Separate init blob upload
Pushing a v2 image layer has two steps:

- POST to get a new upload URL
- PUT to that upload URL

We were previously not checking the response code of
the POST request and the PUT would fail in weird ways.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 73b33db04b29a516bf8c50fbe646f563298fcfd9
Component: engine
2015-03-20 13:11:05 -07:00
54c09d3930 Add verification of image manifest digests
Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 9ececa14ba860c9934d3cd8d3e704e53e828e22b
Component: engine
2015-03-20 09:34:39 -07:00
022bfbf5f3 Merge pull request #11477 from dmcgowan/fix-auth-http-client
Update auth client configuration to use proper tls config
Upstream-commit: 661c31737dde7770d6f9bd5125ce85751887c3b7
Component: engine
2015-03-19 14:17:47 -07:00
5c07713134 Update auth client configuration to use proper tls config
Currently the http clients used by auth use the default tls config.  The config needs to be updated to only support TLS1.0 and newer as well as respect registry insecure configuration.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 959b35d9741e0478209445fa5960d50346cd4ca6
Component: engine
2015-03-18 14:52:49 -07:00
9817390387 print detailed error info for docker pull
When docker push get response with unknown HTTP status, docker daemon
print:
"Error: Status XXX trying to push repository XXX: XXX"
But when docker pull meets response with unknown status code, it gives:
"HTTP code: XXX"

This commit helps docker pull print more detailed error info like push
does, so push and pull can behave consistently when error happens.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
Upstream-commit: efa65d16b6e0b835c1786a47140c974e5c0f71cb
Component: engine
2015-03-18 11:35:44 +08:00
79bbb9fdbf Merge pull request #11118 from shishir-a412ed/restriction_username_length
Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters.
Upstream-commit: a751cc53a751435df516d07a5e85e5f591e63345
Component: engine
2015-03-17 09:41:12 -07:00
d6d379e87a Add ability to refer to image by name + digest
Add ability to refer to an image by repository name and digest using the
format repository@digest. Works for pull, push, run, build, and rmi.

Signed-off-by: Andy Goldstein <agoldste@redhat.com>
Upstream-commit: a2b0c9778feac970524b98ef7a91b5528fdeb9d5
Component: engine
2015-03-17 10:10:42 +00:00
272713f665 Quote registry error strings
Currently when registry error strings contain new line characters only the last line is displayed to the client. Quote the string to ensure the client can see the entire body value.

fixes #11346

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 33c94eb23857f23fb91899b77ba8615c4e6bdadf
Component: engine
2015-03-16 15:32:47 -07:00
1fae595274 Use request factory for registry ping
Currently when the registry ping is sent, it creates the request directly from http.NewRequest instead of from the http request factory. The request factory adds useful header information such as user agent which is needed by the registry.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 55f0ca94e57fc8ec26a79061d04ddd3aeaecb94b
Component: engine
2015-03-16 14:21:00 -07:00
4ea089a09a Docker Tag command: Relax the restriction on namespace (username) length from 30 to 255 characters.
Signed-off-by: Shishir Mahajan <shishir.mahajan@redhat.com>
Upstream-commit: 9839e9784d12a00666ceddbc4f2b1b730da420bc
Component: engine
2015-03-14 16:45:44 -04:00
7a9b88348f Merge pull request #10423 from dmcgowan/v2-registry-fix-single-names
Allow single name component repository names
Upstream-commit: 02e0a23d80a4c19c2d475c3f205eba79a45f8a59
Component: engine
2015-03-09 15:40:22 -04:00
5506a9a27c Remove subdirectories MAINTAINERS files
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
Upstream-commit: 89bdaa35e04b74b7c6528783e0f7b8154b2a3d31
Component: engine
2015-03-06 18:21:51 -08:00
89701d66ba Allow single name component repository names
Private registries should support having images pushed with only a single name component (e.g. localhost:5000/myapp).
The public registry currently requires two name components, but this is already enforced in the registry code.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: a0ca9190cc29215ce9ae69a6187d85bf689c8aa7
Component: engine
2015-03-06 18:18:53 -08:00
968e4c89bb Merge pull request #10425 from dmcgowan/registry-maintainers
Add distribution maintainers to maintainers files
Upstream-commit: a59b6f4ce616aeae7d711461a58566f3d4919480
Component: engine
2015-03-06 17:37:12 -08:00
967da32c28 Rename package timeout to timeoutconn.
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
Upstream-commit: 7e7646c28a599731e62afec4c0c4dc0942309b7f
Component: engine
2015-02-25 20:52:37 +01:00
88b1d37e3b Move TimeoutConn to seperate pkg dir.
Fixes #10965
Signed-off-by: Rik Nijessen <riknijessen@gmail.com>
Upstream-commit: 690a85797e70c3816a1dec768bff0c454e1e23a9
Component: engine
2015-02-25 17:09:47 +01:00
f634216d52 Removing -X flag option and autogenerated code to create Dockerversion.go functionality
Addresses #9207

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 6871b9b16afe46e7566ac2937246b4a64be97269
Component: engine
2015-02-20 05:40:12 +00:00
013dbb146f Pretty the help text
This modifies the "docker help" text so that it is no wider than 80 chars
and each description fits on one line. This will also try to use ~ when
possible

Added a test to make sure we don't go over 80 chars again.
Added a test to make sure we use ~

Applied rules/tests to all docker commands - not just main help text

Closes #10214

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: 2203b37733e76d653cfe3b0ec5870786076adce7
Component: engine
2015-02-04 07:59:16 -08:00
167e1b82bf Merge pull request #10477 from liusdu/liusdu_typo
delete duplicated word in registry/session.go
Upstream-commit: c98007f9d2292b4075e23ceea056209705596ab6
Component: engine
2015-02-03 14:38:47 -08:00
3ae87a3a28 Fix some go vet errors
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 4ee05a4d3e6f9ad955d96075a1e63d59ed73ac78
Component: engine
2015-02-02 14:53:20 -08:00
997f07bcec Merge pull request #10472 from jlhawn/handle_mux_route_url_bug
Handle gorilla/mux route url bug
Upstream-commit: f8331f700babd58d9759f9d0d7d1cb2de0d14346
Component: engine
2015-01-31 19:52:51 -08:00
458fcd5a6c Fix token basic auth header issue
When requesting a token, the basic auth header is always being set even
if there is no username value. This patch corrects this and does not set
the basic auth header if the username is empty.

Also fixes an issue where pulling all tags from a v2 registry succeeds
when the image does not actually exist on the registry.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 8bfdad9a0dee26b45b15f985977769ef37888f8a
Component: engine
2015-01-31 15:12:34 -08:00
1885f8c5c0 Handle gorilla/mux route url bug
When getting the URL from a v2 registry url builder, it does not
honor the scheme from the endpoint object and will cause an https
endpoint to return urls starting with http.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 843f3045bd84987dc9410425b1c116dd957b38c5
Component: engine
2015-01-31 12:54:57 -08:00
a0cace4bff delete duplicated word in registry/session.go
Signed-off-by: Liu Hua <sdu.liu@huawei.com>
Upstream-commit: a131eb55d4f42f3f1e21ac3293f52d3989849568
Component: engine
2015-01-31 20:15:59 +08:00
1c517ad367 Add distribution maintainers to maintainers files
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c1e3f6196124f8c757a7017ae2bba7f8c05fde20
Component: engine
2015-01-28 16:30:00 -08:00
22f9d9e216 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>
Upstream-commit: 86aea582b66929c68de3346a26a26633b62a5784
Component: engine
2015-01-27 18:09:53 -08:00
29be632832 Merge pull request #10249 from jlhawn/distribution_version_header_10247
Split API Version header when checking for v2
Upstream-commit: b9650ad40bd4db3b570f30b158eb9494bb06da8c
Component: engine
2015-01-27 11:48:42 -08:00
e63f5dfefb Better error messaging and logging for v2 registry requests
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: d277714614f62dba276227f70cc2a47eac6e02e7
Component: engine
2015-01-26 14:00:51 -08:00
c43f530252 Fix write after close on http response
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 12d83e727dd3522006b53afbcfac3cdce178117a
Component: engine
2015-01-21 15:14:01 -08:00
f38ca916fb 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)
Upstream-commit: 58c142bcfa2b9edce7efe72d393e9f90b9df9927
Component: engine
2015-01-21 15:08:32 -08:00
a90195f1c8 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)
Upstream-commit: f46923be8eba81dd9e261554128b26a1c83ce398
Component: engine
2015-01-20 19:52:08 -08:00
b098aaedce Merge pull request #9784 from dmcgowan/v2-registry
Client Support for Docker Registry HTTP API V2
Upstream-commit: 8b95ad230e2ee76450ceb9a80aa8e942a56bb397
Component: engine
2015-01-19 10:46:38 -08:00
40a61d0eec 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>
Upstream-commit: b8f7526fc6333e5b67282e5b73eee497dd13ec34
Component: engine
2015-01-17 07:05:56 -05:00
fb2575c794 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)
Upstream-commit: dd914f91d779f64e20ce86767ab4f84f40b9ef6a
Component: engine
2015-01-15 14:05:06 -08:00
5598d30646 Cleanup v2 session to require endpoint
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 9c6f8e14398e794cbe20504556c22a1c83260bd8
Component: engine
2015-01-15 14:05:06 -08:00
e05bd85386 Fix list tags
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 1a9cdb13943c6af397472e235708cb10824681cd
Component: engine
2015-01-15 14:05:06 -08:00