Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement --wait flag for odo project delete #1884

Closed
surajnarwade opened this issue Jul 4, 2019 · 8 comments · Fixed by #2397
Closed

Implement --wait flag for odo project delete #1884

surajnarwade opened this issue Jul 4, 2019 · 8 comments · Fixed by #2397
Assignees
Labels
kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/Medium Nice to have issue. Getting it done before priority changes would be great. v2 Issue or PR that applies to the v2 of odo

Comments

@surajnarwade
Copy link
Contributor

[kind/Enhancement]

Which functionality do you think we should update/improve?

Add --wait flag in odo project delete similar to odo project create

Why is this needed?

Reference: waitForProjectToBeGone from #1739

as of now, vscode plugin relies on,

oc wait project/${project} --for delete
@surajnarwade
Copy link
Contributor Author

cc @kadel @cdrage @dgolovin

@cdrage
Copy link
Member

cdrage commented Aug 28, 2019

Hey @kadel , I'm just reviewing this issue, if I recall correctly, don't we already wait for the project to be deleted? When we run odo project delete foobar, there's an obvious spinner / wait until the project is completely deleted.

@cdrage cdrage self-assigned this Aug 28, 2019
@cdrage cdrage added kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation priority/Medium Nice to have issue. Getting it done before priority changes would be great. points/3 labels Aug 28, 2019
@cdrage
Copy link
Member

cdrage commented Sep 9, 2019

ping @girishramnani

@cdrage
Copy link
Member

cdrage commented Nov 1, 2019

ping @girishramnani @kadel @dgolovin

cdrage added a commit to cdrage/odo that referenced this issue Nov 12, 2019
**What kind of PR is this?**
<!--
DELETE the kind(s) which are not applicable before opening the PR.
-->

/kind feature
/kind enhancement

**What does does this PR do / why we need it**:

Adds `--wait` parameter. Ex. `odo project delete myproject --wait`

**Which issue(s) this PR fixes**:

Fixes redhat-developer#1884

**How to test changes / Special notes to the reviewer**:

```sh
odo project create foobar
odo project delete foobar --wait
```

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
cdrage added a commit to cdrage/odo that referenced this issue Nov 13, 2019
**What kind of PR is this?**
<!--
DELETE the kind(s) which are not applicable before opening the PR.
-->

/kind feature
/kind enhancement

**What does does this PR do / why we need it**:

Adds `--wait` parameter. Ex. `odo project delete myproject --wait`

**Which issue(s) this PR fixes**:

Fixes redhat-developer#1884

**How to test changes / Special notes to the reviewer**:

```sh
odo project create foobar
odo project delete foobar --wait
```

Signed-off-by: Charlie Drage <charlie@charliedrage.com>
@cdrage
Copy link
Member

cdrage commented Nov 18, 2019

Se my current implementation: #2397

I'm having major troubles mitigating ONE niche case and that's essentially when you run odo project create IMMEDIATELY after odo project delete with the same project name.

Here's essentially the TLDR;

  • --wait works. And works well
  • if you do project create with the same name as the project you just deleted, it may fail as your cluster is still propagating changes..

The project is deleted asynchronously by OpenShift. We cannot control this. OpenShift will delete all the pods + project + etc when it wants. No amount of code can fix this. My implementation #2397 even waits for all pods to be deleted, but to no avail. You must wait until the project is completely closed by OpenShift.

This is actually a "feature" of OpenShift and no amount of code would fix it. For example, if you were to create a watch for Project or even Pods (from the deleted project) it'd fail. OpenShift says it's deleted.. oc get projects also shows blank... but when you do oc create project foobar, it'll error out!

Here's an explanation of what happens by Will Gordon @ Red Hat from https://stackoverflow.com/questions/48208001/deleted-openshift-online-pro-project-has-left-a-trace-so-cannot-create-project-o

Projects are deleted asynchronously after you send the delete command. So it's possible that the deletion just hasn't been reconciled yet. It should happen within a minute or so, so try again.

Also, please be aware that in a multitenant environment, like OpenShift Online, you are prevented from creating a project with the same name as any other project in the cluster, even if it's not your own. So if you can't create the project, it's possible that someone has already created a project with the same name.

So for the niche case of:

odo project delete foobar --wait
# create a few components here
odo project create foobar

We cannot support it. You will have to literally wait for your cluster to automatically delete the project. In the case of minishift or crc or something local, this is done almost instantly. But when you are dealing with multi-tenant environments such as OpenShift Online or our internal test cluster, you'll just have to wait for OpenShift to finish.

Ping @girishramnani @amitkrout @kadel @dharmit

@openshift-bot
Copy link

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 26, 2020
@openshift-bot
Copy link

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 25, 2020
@cdrage
Copy link
Member

cdrage commented Apr 27, 2020

/lifecycle frozen

@openshift-ci-robot openshift-ci-robot added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Apr 27, 2020
@rm3l rm3l added the v2 Issue or PR that applies to the v2 of odo label Jun 16, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue as a feature request. For PRs, that means that the PR is the implementation lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/Medium Nice to have issue. Getting it done before priority changes would be great. v2 Issue or PR that applies to the v2 of odo
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants