Allow disabling of starage driver redirects

Storage drivers can implement a method called URLFor which can return a direct
url for a given path. The functionality allows the registry to direct clients
to download content directly from the backend storage. This is commonly used
with s3 and cloudfront. Under certain conditions, such as when the registry is
not local to the backend, these redirects can hurt performance and waste
incoming bandwidth on pulls. This feature addition allows one to disable this
feature, if required.

Signed-off-by: Stephen J Day <stephen.day@docker.com>

Conflicts:
	configuration/configuration.go
	registry/handlers/app.go
	registry/storage/catalog_test.go
	registry/storage/manifeststore_test.go
	registry/storage/registry.go
This commit is contained in:
Stephen J Day 2015-07-23 23:16:27 -07:00
parent 060465882b
commit 9f9a7f230b
10 changed files with 75 additions and 25 deletions

View file

@ -104,6 +104,8 @@ information about each option that appears later in this page.
region: fr
container: containername
rootdirectory: /swift/object/name/prefix
redirect:
disable: false
cache:
blobdescriptor: redis
maintenance:
@ -328,6 +330,8 @@ Permitted values are `error`, `warn`, `info` and `debug`. The default is
age: 168h
interval: 24h
dryrun: false
redirect:
disable: false
The storage option is **required** and defines which storage backend is in use.
You must configure one backend; if you configure more, the registry returns an error.
@ -350,6 +354,21 @@ map.
>are equivalent, `layerinfo` has been deprecated, in favor or
>`blobdescriptor`.
### redirect
The `redirect` subsection provides configuration for managing redirects from
content backends. For backends that support it, redirecting is enabled by
default. Certain deployment scenarios may prefer to route all data through the
Registry, rather than redirecting to the backend. This may be more efficient
when using a backend that is not colocated or when a registry instance is
doing aggressive caching.
Redirects can be disabled by adding a single flag `disable`, set to `true`
under the `redirect` section:
redirect:
disable: true
### filesystem
The `filesystem` storage backend uses the local disk to store registry files. It