Deleting a project should delete it's environments
See original GitHub issueDescribe the bug
At the moment, in order to delete an entire project, you are expected to delete its environments first. Failure to do so will result in orphaned environments in the api-db
database that you cannot remove with GraphQL. It will also mean that the projects continue to run in OpenShift/Kubernetes with no hope of removing them, except manual intervention with oc
/kubectl
.
To Reproduce
Steps to reproduce the behaviour:
- Create project
- Create environment for above project
- Delete project
- Now you cannot delete the environment as the project is deleted
Expected behaviour
2 parts
- If you delete a project, it should loop through all of it’s environments and delete them. Potentially, this is just a matter of amending the stored procedure.
- Create a new stored procedure and API endpoint to allow deleting an environment by it’s ID (rather than project name and environment name).
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Deleting a Project - Oracle Help Center
For this option, the project to be deleted must not have any resources, such as environments, artifacts, build, and deployment pipelines.
Read more >Deleting A Project - Atlassian Community
If you delete a project, you won't affect them. Except for field content, which will be deleted along with the issues holding it....
Read more >Remove or Delete an Item or Project - Microsoft Learn
You can delete a project permanently, but you first need to remove any references to the project from SQL Server Management Studio solutions, ......
Read more >When you are done with a virtual environment, can you just ...
As long as you have your requirements.txt included in the project code, you can delete completely remove the venv and just rebuild it...
Read more >Creating, editing, or deleting a project - Skytap Help
If you have a large number of projects (your account can have up to 1,500 projects), you may want to delete unused projects....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We could do it in the CLI, but it would mean that people would have to update their CLI to get this feature.
I proposed the following solution for the API in the CLI issue related to this https://github.com/amazeeio/lagoon-cli/issues/117#issuecomment-611864789
It makes more sense for the API to handle these sorts of things than hacking it into the CLI
Enviroinments should be deleted before deleting a project. There are now checks for this.