Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1748648

Summary: --wait=true not working for oc delete projects
Product: OpenShift Container Platform Reporter: Mike Fiedler <mifiedle>
Component: openshift-apiserverAssignee: Stefan Schimanski <sttts>
Status: CLOSED WONTFIX QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.0CC: aos-bugs, jokerman, mfojtik, pepper
Target Milestone: ---Keywords: Regression
Target Release: 4.3.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-09-30 13:05:44 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Mike Fiedler 2019-09-04 00:29:46 UTC
Description of problem:

It seems the default for delete projects is --wait=false, which is usually a good thing.  However, --wait=true is no longer working and is sometimes desired (scripting).

Version-Release number of selected component (if applicable): 4.2.0-0.nightly-2019-09-03-102130


How reproducible:
Always

Steps to Reproduce:
1. oc new-project test
2. oc new-app 
3. oc new-app django-psql-example and wait for app to deploy
4. oc delete project test --wait=false 
5. oc get projects

Actual results:

project test is Terminating

Expected results:

oc with --wait=false blocks until project is deleted.


Additional info:

Comment 1 Maciej Szulik 2019-09-04 11:26:41 UTC
The root cause is that the details returned in the status from the server does not contain all the necessary data for wait.
Namely, we're missing project's UUID, see https://github.com/openshift/oc/blob/59eb278865977798198dc71eedead5482e089c5b/vendor/k8s.io/kubernetes/pkg/kubectl/cmd/delete/delete.go#L259-L262
and that field is required for us to know what we're waiting for. Unfortunately, the project resource only returns general
status w/o details, see https://github.com/mfojtik/openshift-apiserver/blob/55d971b2b5aa43b2ae45fed148cf73c149ca79a7/pkg/project/apiserver/registry/project/proxy/proxy.go#L197

I'm moving this to apiserver team, I'll leave the decision up to them.

Comment 2 Mike Fiedler 2019-09-04 11:45:59 UTC
In 3.11, behavior was --wait=true unless overridden.

Comment 3 Michal Fojtik 2019-09-30 13:05:44 UTC
The project are not designed for --wait and users should perform scripting using "namespace" resource instead. This won't be fixed.

Comment 4 pepper@ca.ibm.com 2020-05-25 16:00:17 UTC
Michal Fojtik are you saying you need to do:

`oc delete namespace test --wait=true`

instead of:

`oc delete project test --wait=true`

that doesn't make sense as in openshift project is the proper terminology and what a user interacts with, and namespace is a kubernetes construct.

Comment 5 Red Hat Bugzilla 2023-09-14 05:42:47 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days