Commit Graph

72 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
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
5cfb6b6d7e Fix integration test failures
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 9a38aa0279ccae5aeded854a9cbbd7e398088ab2
Component: engine
2015-01-15 14:05:06 -08:00
07ca876ccc Refactor from feedback
Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 25945a40c4f352a754cbd8dba9c846c7539fe463
Component: engine
2015-01-15 14:05:06 -08:00
c13d2851b8 Add Tarsum Calculation during v2 Pull operation
While the v2 pull operation is writing the body of the layer blob to disk
it now computes the tarsum checksum of the archive before extracting it to
the backend storage driver. If the checksum does not match that from the
image manifest an error is raised.

Also adds more debug logging to the pull operation and fixes existing test
cases which were failing. Adds a reverse lookup constructor to the tarsum
package so that you can get a tarsum object using a checksum label.

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 213e3d116642431adbe634d39740eddc5a81e063
Component: engine
2015-01-15 14:05:05 -08:00
21c36fbac8 Allow private V2 registry endpoints
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 7d61255f578bae7dc5c2a5d44c50bf32bbc9f568
Component: engine
2015-01-15 14:05:05 -08:00
bd2dadaee1 Update push and pull to registry 2.1 specification
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
Upstream-commit: 0336b0cdaa74ac03003c4a933eb866fb0cec8125
Component: engine
2015-01-15 14:05:05 -08:00
5aa04a56fb Deprecating ResolveRepositoryName
Passing RepositoryInfo to ResolveAuthConfig, pullRepository, and pushRepository

Moving --registry-mirror configuration to registry config

Created resolve_repository job

Repo names with 'index.docker.io' or 'docker.io' are now synonymous with omitting an index name.

Adding test for RepositoryInfo

Adding tests for opts.StringSetOpts and registry.ValidateMirror

Fixing search term use of repoInfo

Adding integration tests for registry mirror configuration

Normalizing LookupImage image name to match LocalName parsing rules

Normalizing repository LocalName to avoid multiple references to an official image

Removing errorOut use in tests

Removing TODO comment

gofmt changes

golint comments cleanup.  renaming RegistryOptions => registry.Options, and RegistryServiceConfig => registry.ServiceConfig

Splitting out builtins.Registry and registry.NewService calls

Stray whitespace cleanup

Moving integration tests for Mirrors and InsecureRegistries into TestNewIndexInfo unit test

Factoring out ValidateRepositoryName from NewRepositoryInfo

Removing unused IndexServerURL

Allowing json marshaling of ServiceConfig.  Exposing ServiceConfig in /info

Switching to CamelCase for json marshaling

PR cleanup; removing 'Is' prefix from boolean members.  Removing unneeded json tags.

Removing non-cleanup related fix for 'localhost:[port]' in splitReposName

Merge fixes for gh9735

Fixing integration test

Reapplying #9754

Adding comment on config.IndexConfigs use from isSecureIndex

Remove unused error return value from isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>

Adding back comment in isSecureIndex

Signed-off-by: Don Kjer <don.kjer@gmail.com>
Upstream-commit: 568f86eb186731b907b659e4ec64bda21c2fe31d
Component: engine
2015-01-08 20:14:58 +00:00
166cb2e350 registry: refactor registry.IsSecure calls into registry.NewEndpoint
Signed-off-by: Tibor Vass <teabee89@gmail.com>
Upstream-commit: 4455f517605f1fd7279bbe9547915f15c037997d
Component: engine
2014-11-12 20:34:03 -06:00
4442912970 improve error message to print the tag
Closes #9001

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: bc45428220e4a8d05d9a0cbc701a729f7fe2aa8d
Component: engine
2014-11-11 22:18:40 +00:00
7c60de6972 Add import/pull events to the stream
Closes #8160

Signed-off-by: Doug Davis <dug@us.ibm.com>
Upstream-commit: ef7415258ba5195af7a890d1d52214b3a181a379
Component: engine
2014-11-06 12:12:41 -08:00
a59bba1a32 Merge pull request #8799 from jlhawn/remove_jsondata_arg
Remove `jsonData` argument from `image.StoreImage`
Upstream-commit: 5b03a21963931f917297e52cb17a62680f1c2a6e
Component: engine
2014-11-03 20:55:40 -05:00
ade837e2a4 Remove jsonData argument from image.StoreImage
The argument specified the json data to save to disk when registering
a new image into the image graph. If it is nil, then the given image
is serialized to json and that is written by default. This default
behavior is sufficient if the given image was originally deserialzed
from this jsonData to begin with which has always been the case.

Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
Upstream-commit: 26184de8ab1dfe812094c55c9becd8ebb60ed7be
Component: engine
2014-11-03 17:39:21 -08:00
b74bf3c41f Skip V2 registry and immediately fallback to V1 when mirrors are provided
Since V2 registry does not yet implement mirrors, when mirrors are given automatically fallback to V1 without checking V2 first.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 9d6391a9ebca6c7bd4b262ebb5a4baf9d2c222f9
Component: engine
2014-10-31 18:10:48 -07:00
2339e91d29 Refactor IsSecure change
Fix issue with restoring the tag store and setting static configuration
from the daemon. i.e. the field on the TagStore struct must be made
internal or the json.Unmarshal in restore will overwrite the insecure
registries to be an empty struct.

Signed-off-by: Michael Crosby <michael@docker.com>

Conflicts:
	graph/pull.go
	graph/push.go
	graph/tags.go
Upstream-commit: f29b2e48ebfb171f58375b6e355910fc2192aceb
Component: engine
2014-10-30 19:41:55 -04:00