diff options
| author | David Calavera <david.calavera@gmail.com> | 2015-10-16 18:45:54 -0400 |
|---|---|---|
| committer | David Calavera <david.calavera@gmail.com> | 2015-10-19 14:40:18 -0400 |
| commit | eb982e7c00192c8306f9c420fb469f087c7b161d (patch) | |
| tree | 2d2125136528163149792884cf011e489f665ef2 /errors | |
| parent | 365a0db0f0f105306a8553405fb68a207e8d7754 (diff) | |
| download | docker-eb982e7c00192c8306f9c420fb469f087c7b161d.tar.gz | |
Return 404 for all network operations without network controller.
This will prevent the api from trying to serve network requests in
systems where libnetwork is not enabled, returning 404 responses in any
case.
Signed-off-by: David Calavera <david.calavera@gmail.com>
Diffstat (limited to 'errors')
| -rw-r--r-- | errors/server.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/errors/server.go b/errors/server.go index 9dfcc02b50..1a7af00a13 100644 --- a/errors/server.go +++ b/errors/server.go @@ -24,4 +24,13 @@ var ( Description: "The client version is too old for the server", HTTPStatusCode: http.StatusBadRequest, }) + + // ErrorNetworkControllerNotEnabled is generated when the networking stack in not enabled + // for certain platforms, like windows. + ErrorNetworkControllerNotEnabled = errcode.Register(errGroup, errcode.ErrorDescriptor{ + Value: "NETWORK_CONTROLLER_NOT_ENABLED", + Message: "the network controller is not enabled for this platform", + Description: "Docker's networking stack is disabled for this platform", + HTTPStatusCode: http.StatusNotFound, + }) ) |
