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.
Add parameter to Delete Space to skip deleting OpenShift resources (#…
…2121) When a user resets their environment, the front-end makes calls to the Delete Space API and Clean Tenant API. It makes these calls asynchronously, and due to both APIs acting on the same resources, I suspect this is the reason we are seeing a variety of errors in openshiftio/openshift.io#3500. Since the Clean Tenant API cleans out the user's entire namespaces, it is not necessary in this case for Delete Space to delete anything from OpenShift. This PR adds an optional parameter skipCluster, to the Delete Space API, which if true, will not attempt to delete any deployments from OpenShift. The front-end could then use this parameter only when resetting the user's environment. An alternative would be for the front-end to synchronize between deleting spaces and calling Clean Tenant, but this would be less efficient. Fixes (partially): openshiftio/openshift.io#3500
- Loading branch information
Showing
7 changed files
with
490 additions
and
15 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
104 changes: 104 additions & 0 deletions
104
test/data/codebases/codebases_delete_space.ok-skip-cluster-false.yaml
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,104 @@ | ||
--- | ||
version: 1 | ||
interactions: | ||
- request: | ||
body: "" | ||
form: {} | ||
url: http://core/api/spaces/4d19e0fb-b558-4160-8768-f41cb8169e95/codebases | ||
method: GET | ||
response: | ||
body: '{ | ||
"data": [ | ||
{ | ||
"attributes": { | ||
"createdAt": "2018-04-25T09:19:06.547996Z", | ||
"last_used_workspace": "", | ||
"type": "git", | ||
"url": "https://github.com/surajssd/byebyeworld" | ||
}, | ||
"id": "f3f45151-3dab-4103-baee-bfc0d2a2cbba", | ||
"links": { | ||
"edit": "", | ||
"related": "", | ||
"self": "" | ||
}, | ||
"relationships": { | ||
"space": { | ||
"data": { | ||
"id": "4d19e0fb-b558-4160-8768-f41cb8169e95", | ||
"type": "spaces" | ||
}, | ||
"links": { | ||
"related": "", | ||
"self": "" | ||
} | ||
}, | ||
"workspaces": { | ||
"links": { | ||
"related": "", | ||
"self": "" | ||
} | ||
} | ||
}, | ||
"type": "codebases" | ||
}, | ||
{ | ||
"attributes": { | ||
"createdAt": "2018-04-25T10:15:19.548216Z", | ||
"last_used_workspace": "", | ||
"type": "git", | ||
"url": "https://github.com/surajssd/heyheyworld" | ||
}, | ||
"id": "aed02e9b-1b51-4fa8-98c9-06ef56a28c88", | ||
"links": { | ||
"edit": "", | ||
"related": "", | ||
"self": "" | ||
}, | ||
"relationships": { | ||
"space": { | ||
"data": { | ||
"id": "4d19e0fb-b558-4160-8768-f41cb8169e95", | ||
"type": "spaces" | ||
}, | ||
"links": { | ||
"related": "", | ||
"self": "" | ||
} | ||
}, | ||
"workspaces": { | ||
"links": { | ||
"related": "", | ||
"self": "" | ||
} | ||
} | ||
}, | ||
"type": "codebases" | ||
} | ||
], | ||
"links": { | ||
"first": "", | ||
"last": "" | ||
}, | ||
"meta": { | ||
"totalCount": 2 | ||
} | ||
}' | ||
# headers: | ||
|
||
status: 200 OK | ||
code: 200 | ||
- request: | ||
url: http://core/api/codebases/f3f45151-3dab-4103-baee-bfc0d2a2cbba | ||
method: DELETE | ||
response: | ||
# headers: | ||
status: 200 OK | ||
code: 204 | ||
- request: | ||
url: http://core/api/codebases/aed02e9b-1b51-4fa8-98c9-06ef56a28c88 | ||
method: DELETE | ||
response: | ||
# headers: | ||
status: 200 OK | ||
code: 204 |
Oops, something went wrong.