Commit Graph

85 Commits

Author SHA1 Message Date
04b3252768 Add transport package to support CancelRequest
Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: 73823e5e56446b23ce01bb8e44a9670ab2552b0a
Component: engine
2015-05-18 23:31:42 -04:00
14d2347fac registry: Refactor requestfactory to use http.RoundTrippers
This patch removes the need for requestFactories and decorators
by implementing http.RoundTripper transports instead.

It refactors some challenging-to-read code.

NewSession now takes an *http.Client that can already have a
custom Transport, it will add its own auth transport by wrapping
it.

The idea is that callers of http.Client should not bother
setting custom headers for every handler but instead it should
be transparent to the callers of a same context.

This patch is needed for future refactorings of registry,
namely refactoring of the v1 client code.

Signed-off-by: Tibor Vass <tibor@docker.com>
Upstream-commit: a01cc3ca7729c3ce635fef7c1db837b5c6ae1028
Component: engine
2015-05-18 21:51:53 -04:00
aeecef0f70 Refactor pkg/stremformatter with custom constructors instead of passing a boolean
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 6b700bdacae0b416d8239a0a24729fe327d425d1
Component: engine
2015-05-13 00:09:41 +02:00
4a0ddadbc0 Remove API codepaths < 1.12
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 7284b08204fb85838170bdf82e2c379e1a4713c9
Component: engine
2015-05-12 20:09:49 +02:00
954f940156 Small if err cleaning
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: 844538142d95c1b7dda1bb2903179510105fe9b5
Component: engine
2015-04-27 21:50:33 +02:00
88eea81abe Merge pull request #12655 from jlhawn/fix_12281
Validate repo name before image pull
Upstream-commit: 68fc79f5924bc76111422eec5b7713a586febd96
Component: engine
2015-04-23 13:12:12 -07:00
8cb2465efc Validate repo name before image pull
Checks for reserved 'scratch' image name.

fixes #12281

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 18f46883851e47387ec2bd116940cdae97ba3c8d
Component: engine
2015-04-23 11:44:46 -07:00
c8f1332dce Move CLI config processing out from under registry dir
No logic changes should be in here, just moving things around.

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: bb9da6ba9294a8eab8f4dfaf7cf07c57959fe608
Component: engine
2015-04-23 10:18:38 -07:00
43e79cc411 Remove chain of engine passing from builder to loadManifest
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a2f74aa4b449479dc3953b129c839ca90b089494
Component: engine
2015-04-21 14:55:23 -07:00
0790d1610c Remove engine from trust
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 9e50bf6270f426f6ef6649b1985036988b207407
Component: engine
2015-04-20 12:48:33 -07:00
14bae8f05b Merge pull request #12358 from ZJU-SEL/remove_job_from_tag
remove job from tag
Upstream-commit: b1d8ae3824d2902c86d63837b8d413952b546d62
Component: engine
2015-04-19 16:02:28 -04:00
dd5f4141fe remove job from tag
Signed-off-by: Simei He <hesimei@zju.edu.cn>
Upstream-commit: 99f6309b97041bf82cc845340734dc8e47977c8a
Component: engine
2015-04-19 18:36:56 +08:00
0ff275f7b4 remove job from pull and import
Closes #12396

Signed-off-by: Simei He <hesimei@zju.edu.cn>

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 6e38a53f96403b4cbd38e49e6b294128ed054a20
Component: engine
2015-04-17 09:55:02 -07:00
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
0d3afdf0c8 Remove engine usage for events
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: c9eb37f9752d72d9a4280d703368e5e73adfffa1
Component: engine
2015-04-07 08:43:18 -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
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
29d7b5b844 Merge pull request #11841 from runcom/11762-replace-aliased-logrus-imports
Replace aliased imports of logrus
Upstream-commit: 756b8f2fde210da5529e0a5480e149917ab25524
Component: engine
2015-03-26 16:49:01 -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
ed7e44e788 Consider tag updated also in case repo does not exist
This patch causes `The image you are pulling has been verified` status
message to be produced also when the repository is pulled for the first
time.

Signed-off-by: Michal Minar <miminar@redhat.com>
Upstream-commit: 3b8d4bb82ba6abf728cd40c838bfd665f8d10639
Component: engine
2015-03-26 12:52:56 +01:00
0ee1e9f604 Fixes hacks from progressreader refactor
related to #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 0cd6c05d8112e9246b734107d54e2855e3d5fec5
Component: engine
2015-03-25 18:21:02 -07: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
1e47557825 Refactor pkg/common, Fixes #11599
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: b80fae735684406d848b16a0f148a746e17ed25f
Component: engine
2015-03-24 18:19:59 +01:00
919e9683e3 Enable v2 default push
When pushing to the official registry, v2 push will be attempted first. If the v2 endpoint is unavailable, a push to v1 will occur. If a v2 push is started and failed, the push operation will fail. Pulling non-official images the official v2 registry is also enabled to pull the newly push images. When a pull of a v2 image fails, v1 will always be attempted.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 770e9b6b819b495a933b2f467bf768a1b785d5ad
Component: engine
2015-03-20 11:09:33 -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
3105d32a23 Support push and pull of sha256
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 514be385f7451df8bbf9e1a7bb015e3baec406f1
Component: engine
2015-03-17 10:50:35 -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
eda2d7f6c9 Merge pull request #11419 from dmcgowan/fix-test-pull-verified
Fix test pull verified
Upstream-commit: 2550c306eb737c75f331454fa372bc5700b566f4
Component: engine
2015-03-16 14:23:59 -07:00
f32b25fee3 Fix test pull verified
Update pull code to consider any layer download or new tag as an update.
Update hello-world frozen image to be explicitly tagged as frozen, to not interfere with pull tests.  The hello-world is used by pull tests because of its small size and there is no other official image with such a size.

fixes #11383

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 636037c3637eb1d09cc469cebe39ffb915bb0aa9
Component: engine
2015-03-16 12:22:00 -07:00
6283bdf158 Remove import to utils in progressreader
Added method in StreamFormatter to handle calls
from progressreader. Solves #10959

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
Upstream-commit: 12b278d3540bc32699e8c2197b556188fd98b77b
Component: engine
2015-03-11 00:50:27 -07:00
1d55bf7466 Check for error when copying v2 image blob to temp
The call to io.Copy was not being checked for errors at a critical point in the
pull logic. This patch will log the error value if not nil.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 6564e0ad2f63257458a5bad68f47504223b00285
Component: engine
2015-03-06 18:03:39 -08:00
bdb65abebf Removing dependencies from pkg into Docker internal code
Closes #10922

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: 7a9c944b827dc0cd416d701fe6460264f05166bb
Component: engine
2015-02-23 18:43:10 +00:00
9a0fe3fe5e Merge pull request #10520 from dmcgowan/v2-registry-fallback-logging
Upstream-commit: a0a27e6a58d7c694bfe6f71ce1ccfc1589373675
Component: engine
2015-02-19 17:20:34 -05:00
82000202e2 Merge pull request #10696 from dmcgowan/remove-nonofficial-trust-check
Upstream-commit: 47f60014162d4cc371513352085605cad98f1ed3
Component: engine
2015-02-19 16:09:52 -05:00
4a9bcf2320 Merge pull request #10571 from jfrazelle/8689-remove-all-aliases
Removes the feature to pull all image aliases.
Upstream-commit: 9ea20f260c0a31d6a0e939a099f7005e93507eea
Component: engine
2015-02-16 10:29:20 -08:00
3206ea9ad0 Update the trust graph only when pulling an official image
The trust graph currently pulls the keys needed to verify official images. For non-official images this graph check is useless. To avoid hitting the key statement url when pulling from private v2 registries, restrict the check to official image pulls.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 8d1a0086c1a9297c2dc44a997134de7d30d0498f
Component: engine
2015-02-10 16:08:57 -08:00
e071644a3f Update verification message logic
Only show the verification message if all the tarsum checks pass and the image manifest is verified.
No longer return an error when a tarsum verification fails, just reset the verification flag.
Tarsum verification is less meaningful without a verified manifest and therefore it should not cause an error.
Updated the verified image test to pull an image which expected to have a verified manifest and contents.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 6088df20c33afafa523b9dd9b0acdd3b987c4534
Component: engine
2015-02-05 17:46:55 -08:00
c75462bc54 Removes the feature to pull all image aliases.
It didn't work on v2 anyways. And an image with a lot of aliases was slow to
fetch.

Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <princess@docker.com> (github: jfrazelle)
Upstream-commit: 72a9000fcfa2ec5a2c4a29fb62a17c34e6dd186f
Component: engine
2015-02-04 15:06:34 -08:00
fe554d875d Reduce logging when official v2 registry is unavailable
On pull treat an unavailable v2 registry as a non-error fallback.
On push only show v2 error message in debug mode.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c8a06069bcee4214cd03468343aec7fcc4a37143
Component: engine
2015-02-04 13:23:13 -08:00
d859bcf5f3 Limit push and pull to v2 official registry
No longer push to the official v2 registry when it is available. This allows pulling images from the v2 registry without defaulting push. Only pull official images from the v2 official registry.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 88fdcfef02cdc8b4fcff10cded6a89a42a360ec1
Component: engine
2015-02-04 09:21:36 -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
12b02aa7f6 Revert client signature
Supports multiple tag push with daemon signature

Fixes #10444

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 403d981d70dc8a493a9a10be4b5d2e2ce871f380
Component: engine
2015-01-30 14:20:32 -08:00
1c5b6614c3 Make debugs logs suck less.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c49cd3d2a51ad6d2304c24f7b609cde804a0d6c5
Component: engine
2015-01-23 13:20:29 -08:00
72b2fe27b4 Change the wording of image verification warning.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: c97d8b1233bc17a9e58ce97473329ab5de59969a
Component: engine
2015-01-21 18:07:10 -08:00
366e7721bb Warn about tech preview of checksums.
Docker-DCO-1.1-Signed-off-by: Jessica Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 1820003078eeae6ab25e2440669c490caff59b57
Component: engine
2015-01-21 16:25:01 -08:00
45e09641f7 Remove session backup
The v2 session code will no longer update the indexEndpoint value, therefore it is not necessary to save and restore the value for use with v1.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: f11f3f6203da596f50eec0edc3c5dfb8c93bc271
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
5fc27fb46a Refactor push and pull to move code out of cmd function
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 750b41ced42bda0ccda405c1aa7c43ded5821e40
Component: engine
2015-01-15 14:05:06 -08:00