Skip to content

Commit bbac9ee

Browse files
Merge pull request moby#28532 from stevvooe/disabled-swarm-service-unavailable
api/server/httputils: service unavailable for disable swarm
2 parents e61ad74 + 1d90d76 commit bbac9ee

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

api/server/httputils/errors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func GetHTTPErrorStatusCode(err error) int {
6262
{"wrong login/password", http.StatusUnauthorized},
6363
{"unauthorized", http.StatusUnauthorized},
6464
{"hasn't been activated", http.StatusForbidden},
65-
{"this node", http.StatusNotAcceptable},
65+
{"this node", http.StatusServiceUnavailable},
6666
} {
6767
if strings.Contains(errStr, status.keyword) {
6868
statusCode = status.code

api/swagger.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6731,14 +6731,14 @@ paths:
67316731
description: "bad parameter"
67326732
schema:
67336733
$ref: "#/definitions/ErrorResponse"
6734-
406:
6735-
description: "node is already part of a swarm"
6736-
schema:
6737-
$ref: "#/definitions/ErrorResponse"
67386734
500:
67396735
description: "server error"
67406736
schema:
67416737
$ref: "#/definitions/ErrorResponse"
6738+
503:
6739+
description: "node is already part of a swarm"
6740+
schema:
6741+
$ref: "#/definitions/ErrorResponse"
67426742
parameters:
67436743
- name: "body"
67446744
in: "body"
@@ -6773,14 +6773,14 @@ paths:
67736773
responses:
67746774
200:
67756775
description: "no error"
6776-
406:
6777-
description: "node is not part of a swarm"
6778-
schema:
6779-
$ref: "#/definitions/ErrorResponse"
67806776
500:
67816777
description: "server error"
67826778
schema:
67836779
$ref: "#/definitions/ErrorResponse"
6780+
503:
6781+
description: "node is not part of a swarm"
6782+
schema:
6783+
$ref: "#/definitions/ErrorResponse"
67846784
parameters:
67856785
- name: "force"
67866786
description: "Force leave swarm, even if this is the last manager or that it will break the cluster."
@@ -6800,14 +6800,14 @@ paths:
68006800
description: "bad parameter"
68016801
schema:
68026802
$ref: "#/definitions/ErrorResponse"
6803-
406:
6804-
description: "node is not part of a swarm"
6805-
schema:
6806-
$ref: "#/definitions/ErrorResponse"
68076803
500:
68086804
description: "server error"
68096805
schema:
68106806
$ref: "#/definitions/ErrorResponse"
6807+
503:
6808+
description: "node is not part of a swarm"
6809+
schema:
6810+
$ref: "#/definitions/ErrorResponse"
68116811
parameters:
68126812
- name: "body"
68136813
in: "body"
@@ -6877,10 +6877,6 @@ paths:
68776877
type: "string"
68786878
example:
68796879
ID: "ak7w3gjqoa3kuz8xcpnyy0pvl"
6880-
406:
6881-
description: "server error or node is not part of a swarm"
6882-
schema:
6883-
$ref: "#/definitions/ErrorResponse"
68846880
409:
68856881
description: "name conflicts with an existing service"
68866882
schema:
@@ -6889,6 +6885,10 @@ paths:
68896885
description: "server error"
68906886
schema:
68916887
$ref: "#/definitions/ErrorResponse"
6888+
503:
6889+
description: "server error or node is not part of a swarm"
6890+
schema:
6891+
$ref: "#/definitions/ErrorResponse"
68926892
parameters:
68936893
- name: "body"
68946894
in: "body"

docs/reference/api/docker_remote_api_v1.25.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4821,7 +4821,7 @@ Initialize a new swarm. The body of the HTTP response includes the node ID.
48214821
48224822
- **200** – no error
48234823
- **400** – bad parameter
4824-
- **406** – node is already part of a swarm
4824+
- **503** – node is already part of a swarm
48254825
48264826
JSON Parameters:
48274827
@@ -4890,7 +4890,7 @@ Join an existing swarm
48904890
48914891
- **200** – no error
48924892
- **400** – bad parameter
4893-
- **406** – node is already part of a swarm
4893+
- **503** – node is already part of a swarm
48944894
48954895
JSON Parameters:
48964896
@@ -4928,7 +4928,7 @@ Leave a swarm
49284928
**Status codes**:
49294929
49304930
- **200** – no error
4931-
- **406** – node is not part of a swarm
4931+
- **503** – node is not part of a swarm
49324932
49334933
### Retrieve the swarm's unlock key
49344934
@@ -5024,7 +5024,7 @@ Update a swarm
50245024
50255025
- **200** – no error
50265026
- **400** – bad parameter
5027-
- **406** – node is not part of a swarm
5027+
- **503** – node is not part of a swarm
50285028
50295029
JSON Parameters:
50305030
@@ -5268,8 +5268,8 @@ image](#create-an-image) section for more details.
52685268
**Status codes**:
52695269
52705270
- **201** – no error
5271-
- **406** – server error or node is not part of a swarm
52725271
- **409** – name conflicts with an existing object
5272+
- **503** – server error or node is not part of a swarm
52735273
52745274
**JSON Parameters**:
52755275
@@ -6049,8 +6049,8 @@ Create a secret
60496049
**Status codes**:
60506050
60516051
- **201** – no error
6052-
- **406** – server error or node is not part of a swarm
60536052
- **409** – name conflicts with an existing object
6053+
- **503** – server error or node is not part of a swarm
60546054
60556055
**JSON Parameters**:
60566056

0 commit comments

Comments
 (0)