forked from TrueCloudLab/distribution
Add a read-only mode as a configuration option
Add "readonly" under the storage/maintenance section. When this is set to true, uploads and deletions will return 503 Service Unavailable errors. Document the parameter and add some unit testing. Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
This commit is contained in:
parent
5a8fabfee3
commit
df9758ba39
7 changed files with 92 additions and 12 deletions
|
@ -133,4 +133,14 @@ var (
|
|||
longer proceed.`,
|
||||
HTTPStatusCode: http.StatusNotFound,
|
||||
})
|
||||
|
||||
// ErrorCodeMaintenanceMode is returned when an upload can't be
|
||||
// accepted because the registry is in maintenance mode.
|
||||
ErrorCodeMaintenanceMode = errcode.Register(errGroup, errcode.ErrorDescriptor{
|
||||
Value: "MAINTENANCE_MODE",
|
||||
Message: "registry in maintenance mode",
|
||||
Description: `The upload cannot be accepted because the registry
|
||||
is running read-only in maintenance mode.`,
|
||||
HTTPStatusCode: http.StatusServiceUnavailable,
|
||||
})
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue