This repository has been archived by the owner on Mar 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for "url.Error: Delete http://f8tenant:80/api/tenant?remove=false…
…: EOF" (#2092) The expected response code is `204`, not `200` * apply status code range check * use the response status to produce an error * handle decode errors and empty JSON-API errors * support other error, including with empty msg Fixes openshiftio/openshift.io#3526 Signed-off-by: Xavier Coulon <[email protected]>
- Loading branch information
1 parent
a83a862
commit 60b9d64
Showing
4 changed files
with
141 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
headers: | ||
sub: ["bcdd0b29-123d-11e8-a8bc-b69930b94f5c"] # will be compared against the `sub` claim in the incoming request's token | ||
url: http://tenant/api/tenant?remove=false | ||
method: DELETE | ||
response: | ||
status: 204 No Content | ||
code: 204 | ||
- request: | ||
headers: | ||
sub: ["83fdcae2-634f-4a52-958a-f723cb621700"] # will be compared against the `sub` claim in the incoming request's token | ||
url: http://tenant/api/tenant?remove=false | ||
method: DELETE | ||
response: | ||
status: 500 Internal Server Error | ||
code: 500 | ||
body: '{ | ||
"errors":[{ | ||
"code": "500", | ||
"detail": "unable to fetch cluster", | ||
"id": "83fdcae2-634f-4a52-958a-f723cb621700" | ||
}] | ||
}' | ||
- request: | ||
headers: | ||
sub: ["2610c5dc-d700-4b86-b979-2b103e0b1144"] # will be compared against the `sub` claim in the incoming request's token | ||
url: http://tenant/api/tenant?remove=false | ||
method: DELETE | ||
response: | ||
status: 401 Unauthorized | ||
code: 401 | ||
body: '{ | ||
"errors":[{ | ||
"code": "401", | ||
"detail": "unauthorized", | ||
"id": "2610c5dc-d700-4b86-b979-2b103e0b1144" | ||
}] | ||
}' | ||
- request: | ||
headers: | ||
sub: ["73a3b0ce-4917-44db-9979-90b1219ca2c6"] # will be compared against the `sub` claim in the incoming request's token | ||
url: http://tenant/api/tenant?remove=false | ||
method: DELETE | ||
response: | ||
status: 418 I'm a teapot | ||
code: 418 | ||
# no response body, on purpose |