Merge pull request #31141 from thaJeztah/swarm-node-error-return-503

fix status-code for "locked" swarm and "certificate expired"
(cherry picked from commit 6486924f0b)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2017-02-17 21:10:45 -08:00 committed by Sebastiaan van Stijn
parent dffbf0bc73
commit b0e4cf1ad2
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,8 @@ func GetHTTPErrorStatusCode(err error) int {
{"unauthorized", http.StatusUnauthorized},
{"hasn't been activated", http.StatusForbidden},
{"this node", http.StatusServiceUnavailable},
{"needs to be unlocked", http.StatusServiceUnavailable},
{"certificates have expired", http.StatusServiceUnavailable},
} {
if strings.Contains(errStr, status.keyword) {
statusCode = status.code