Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

API: Need expanded delete space functionality #1746

Closed
dgutride opened this issue Jan 2, 2018 · 10 comments
Closed

API: Need expanded delete space functionality #1746

dgutride opened this issue Jan 2, 2018 · 10 comments

Comments

@dgutride
Copy link
Collaborator

dgutride commented Jan 2, 2018

Goal would be to have a DELETE /api/spaces/{id} to support UI in this story:

fabric8-ui/fabric8-ux#610

Delete should not just delete the space from the platform database, all labeled space entries on openshift should also be removed so we don't orphan entries.

Internally call:

  • Deployment API for OSO App Removal
  • Che for Workspace Delete

Long term:

  • Build confirmation into the API
    • Delete Space
      • Are you sure you want to Delete X, Y, Z child resources 'link'
        • Delete 'link'
@aslakknutsen
Copy link
Collaborator

Openshift resources are easy enough assuming all the labeling matches(I think the route is missing it atm), but just that would leave GitHub repos with orphan webhooks as well as Che workspaces referring the codebases.

@jiekang
Copy link
Collaborator

jiekang commented Mar 19, 2018

Also, the Deployments API supports deletion of deployments in Openshift. It could be used as a reference, or directly to assist with this.

This begins at:
controller/deployments.go:func (c *DeploymentsController) DeleteDeployment(ctx *app.DeleteDeploymentDeploymentsContext) error {

@ebaron
Copy link
Collaborator

ebaron commented Mar 19, 2018

Following up on the API Jie pointed out, currently this deletes the following for a deployment (an application within one environment):

  • Deployment Config
  • Replication Controllers
  • Pods
  • Services
  • Routes

We could expand on this to support deleting a whole application across environments, or all applications within a space.

@joshuawilson
Copy link
Member

Sounds like this might move us along faster, thanks.

@aslakknutsen
Copy link
Collaborator

From the UI point of view Delete space should be enough. The rest should be orchestrated internally

@joshuawilson
Copy link
Member

I agree. However, the current design has delete/remove on several components including Deployments. I want to confirm that you are NOT commenting on that functionality.

@aslakknutsen
Copy link
Collaborator

@joshuawilson Not sure I understand your comment. Multiple objects or not, the UI shouldn't care. The action the UI care about is Delete space.

@joshuawilson
Copy link
Member

I was referencing "The rest should be orchestrated internally" comment. Just to make sure you didn't want the functionality removed from the UI components that delete parts. I didn't think you did, just confirming.

@aslakknutsen
Copy link
Collaborator

@joshuawilson

Should the UI be able to Delete a single Deployment? yes
Should the UI be able to Delete a Single space? yes
Should the UI have to call Delete on every Deployment within a Space before/when calling Delete Space? No!
Should the UI have to find all the related child objects when deleting a parent? No!

@joshuawilson
Copy link
Member

Agreed. :)

@joshuawilson joshuawilson assigned surajssd and unassigned xcoulon Mar 27, 2018
@joshuawilson joshuawilson modified the milestones: Sprint 146, Sprint 147 Mar 27, 2018
aslakknutsen pushed a commit to fabric8-services/fabric8-wit that referenced this issue May 4, 2018
…ace (#1966)

When a space is deleted also delete codebases associated with it and
after that delete the OpenShift resources consumed by the space.

Fixes openshiftio/openshift.io#1746
aslakknutsen pushed a commit to fabric8-services/fabric8-wit that referenced this issue May 5, 2018
Before when codebases were deleted we were only checking if the return
code is 200. But the codebase deletion API returns 204 or No content. So
this commit fixes that, by adding a check for all return code from 200
to 299.

Related to openshiftio/openshift.io#1746
xcoulon pushed a commit to fabric8-services/fabric8-common that referenced this issue Jul 4, 2018
…ace (#1966)

When a space is deleted also delete codebases associated with it and
after that delete the OpenShift resources consumed by the space.

Fixes openshiftio/openshift.io#1746
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants