Commit Graph

21 Commits

Author SHA1 Message Date
30f1b651e2 Remove string checking in API error handling
Use strongly typed errors to set HTTP status codes.
Error interfaces are defined in the api/errors package and errors
returned from controllers are checked against these interfaces.

Errors can be wraeped in a pkg/errors.Causer, as long as somewhere in the
line of causes one of the interfaces is implemented. The special error
interfaces take precedence over Causer, meaning if both Causer and one
of the new error interfaces are implemented, the Causer is not
traversed.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: ebcb7d6b406fe50ea9a237c73004d75884184c33
Component: engine
2017-08-15 16:01:11 -04:00
643654c2f0 Spelling fixes
* additional
* ambiguous
* anonymous
* anything
* application
* because
* before
* building
* capabilities
* circumstances
* commit
* committer
* compresses
* concatenated
* config
* container
* container's
* current
* definition
* delimiter
* disassociates
* discovery
* distributed
* doesnotexist
* downloads
* duplicates
* either
* enhancing
* enumerate
* escapable
* exactly
* expect
* expectations
* expected
* explicitly
* false
* filesystem
* following
* forbidden
* git with
* healthcheck
* ignore
* independent
* inheritance
* investigating
* irrelevant
* it
* logging
* looking
* membership
* mimic
* minimum
* modify
* mountpoint
* multiline
* notifier
* outputting
* outside
* overridden
* override
* parsable
* plugins
* precedence
* propagation
* provided
* provides
* registries
* repositories
* returning
* settings
* should
* signals
* someone
* something
* specifically
* successfully
* synchronize
* they've
* thinking
* uninitialized
* unintentionally
* unmarshaling
* unnamed
* unreferenced
* verify

Signed-off-by: Josh Soref <jsoref@gmail.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Upstream-commit: 39bcaee47b8a284a46b761afe218ba7deda0d482
Component: engine
2017-07-03 13:13:09 -07:00
3af9801344 LCOW: Move daemon stores to per platform
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: 3aa4a0071536d3b106374eaa44d8a55765901aa6
Component: engine
2017-06-20 19:49:52 -07:00
348e71b4b8 reference: handle combination of tag and digest in ImageDelete
If you remove an image with digest+tag, it will fail because it wont
find it in the reference store (where digest+tag -> digest). Let's
make sure we do the same in ImageDelete, stripping the tag if
digest+tag are present.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
Upstream-commit: 0fbfeb17e5a135cfd40ea07ab64d6e6bcf903e44
Component: engine
2017-02-16 10:48:40 +01:00
d927b05cf2 reference: Handle combination of tag and digest in AddReference
With the switchover to the unified reference package, AddReference no
longer does the right thing when passed a reference that has both a
digest and a tag. It would put both the digest in the tag in the
reference stored in the repositories.json file, which isn't the right
format, and would mean that neither "docker run" nor docker services
could locate the image. This meant that a simple "docker service create"
command like "docker service create --name foo busybox top" would create
a service that immediately went into a restart loop, because it couldn't
use the image that had been pulled.

Fix AddReference to strip out the tag when both a tag and digest are
specified. We do this because we don't necessarily want to overwrite the
tag - when both a digest and tag are specified, the tag is only
advisory.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: b7a2d85316314112809e8e2f6abf84bb10428f38
Component: engine
2017-02-09 16:30:46 -08:00
2260389fe6 Use distribution reference
Remove forked reference package. Use normalized named values
everywhere and familiar functions to convert back to familiar
strings for UX and storage compatibility.

Enforce that the source repository in the distribution metadata
is always a normalized string, ignore invalid values which are not.
Update distribution tests to use normalized values.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 3a1279393faf78632bf169619d407e584da84b66
Component: engine
2017-02-07 11:08:37 -08:00
027b11b8c3 Remove use of forked reference package for cli
Use resolving to repo info as the split point between the
legitimate reference package and forked reference package.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: 0421f5173dbdcb4e4eade5267f274302bb6ab97c
Component: engine
2017-01-19 16:04:50 -08:00
775c5633ef *: use opencontainers/go-digest package
The `digest` data type, used throughout docker for image verification
and identity, has been broken out into `opencontainers/go-digest`. This
PR updates the dependencies and moves uses over to the new type.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
Upstream-commit: 7a855799175b6b984886ef1cfa337d6df1d4c668
Component: engine
2017-01-06 18:48:41 -08:00
42b7611762 Move imageID validation to stringid pkg
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 9f3046f9a03f1a710bdb7fcddd37ff50e71e31c3
Component: engine
2016-12-26 18:53:22 -08:00
bd1e79dcf0 checkt t.Fatalf information for reference path
Signed-off-by: lixiaobing10051267 <li.xiaobing1@zte.com.cn>
Upstream-commit: 4b1ff89faed5a04d1220c2953b8e72eb4e651dcb
Component: engine
2016-11-30 17:54:41 +08:00
874be028c3 Update for distribution vendor
Handle updates to reference package.
Updates for refactoring of challenge manager.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Upstream-commit: c85eb008416f352327b67dce351101591cd5f781
Component: engine
2016-11-10 17:34:12 -08:00
00676d4d53 Generalize content addressable and reference storage
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 805223982ce7469af0fc42fc4a5115055f7b4843
Component: engine
2016-09-15 18:08:19 -07:00
cd9c4588e1 reference: Do not drop the underlying error message
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
Upstream-commit: 69dae0a5fb4049e045ce0d2424496223d0e2cd0b
Component: engine
2016-07-01 11:57:43 +02:00
35c5774373 fix typos
Signed-off-by: allencloud <allen.sun@daocloud.io>
Upstream-commit: c1be45fa38e82054dcad606d71446a662524f2d5
Component: engine
2016-06-02 17:17:22 +08:00
e3c27e0ed4 Safer file io for configuration files
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ea3cbd3274664f5b16fce78d7df036f6b5c94e30
Component: engine
2016-04-21 11:31:15 -07:00
7d0b608cf5 Fix docker run for 64 byte hex ID
Fixes #20972

Also makes sure there is no check to registry if
no image is found for the prefixed IDs.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 16e4c4e481aca8d5a99d5a4760b5d27bf5bbb9fd
Component: engine
2016-03-11 10:02:47 -08:00
176a1e6aa2 Allow uppercase characters in image reference hostname
This PR makes restores the pre-Docker 1.10 behavior of allowing
uppercase characters in registry hostnames.

Note that this only applies to hostnames, not remote image names.
Previous versions also prohibited uppercase letters after the hostname,
but Docker 1.10 extended this to the hostname itself.

- Vendor updated docker/distribution.

- Add a check to "normalize" that rejects remote names with uppercase
  letters.

- Add test cases to TestTagValidPrefixedRepo and
  TestTagInvalidUnprefixedRepo

Fixes: #20056

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
Upstream-commit: e2afab9c4a8be800dffee9b60b2197350987543c
Component: engine
2016-02-10 14:03:41 -08:00
31f577ea49 Clean up reference type switches
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: eeb2d4c1adbe4e00f9fbcdc70f9ac31997968e1d
Component: engine
2015-12-16 11:58:53 -08:00
d17a157710 Improve reference parse errors
Fixes #18093

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 15d84a3a48efa12ed8bdc500f28ca58a7b1d1083
Component: engine
2015-12-16 11:58:53 -08:00
9b8bb0d4e1 Update Named reference with validation of conversions
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: ffded61dad76e4c6530359d879afe83907e409a7
Component: engine
2015-12-16 11:58:52 -08:00
020b74d545 Add own reference package wrapper
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Upstream-commit: 2655954c2dd9d92c2394b04e4262543174c4c038
Component: engine
2015-12-16 11:58:52 -08:00