Bug 1202707 - [origin_runtime_664] Should notify user that the current using project doesn't exist anymore after deleted by admin
Summary: [origin_runtime_664] Should notify user that the current using project doesn'...
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 3.x
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: libra bugs
Depends On:
TreeView+ depends on / blocked
Reported: 2015-03-17 09:40 UTC by Meng Bo
Modified: 2015-05-15 02:06 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2015-04-21 18:00:26 UTC
Target Upstream Version:

Attachments (Terms of Use)

Description Meng Bo 2015-03-17 09:40:53 UTC
Description of problem:
Try to use the previous owning project which has been deleted by cluster-admin via user, there is no warning message about the using project has been deleted.

Version-Release number of selected component (if applicable):
openshift v0.4.1-101-g0ac00c6
kubernetes v0.11.0-330-g6241a21

How reproducible:

Steps to Reproduce:
1. Setup openshift v3 env
2. Create project and set the user to user2
# openshift ex new-project project21 --admin="anypassword:user2"
3. Create pod in this project with the user2
$ osc login -u user2
$ osc create -f pod.json
4. Delete the project via admin
# osc delete project project21
5. Try to get/delete/create the pods via the user2
$ osc get po
$ osc delete po --all
$ osc create po -f pod.json
6. Check the user's context
$ openshift ex config view --kubeconfig=.config/openshift/.config
7. Try to login again with the user

Actual results:
5. All the actions work
6. The user still using the deleted project.
$ openshift ex config view --kubeconfig=.config/openshift/.config
apiVersion: v1
- cluster:
    insecure-skip-tls-verify: true
    server: https://localhost:8443
  name: localhost:8443
- context:
    cluster: localhost:8443
    namespace: project21
    user: user2
  name: localhost:8443-user2
- context:
    cluster: localhost:8443
    user: user2
  name: localhost:8443-user2-0
current-context: localhost:8443-user2
kind: Config
preferences: {}
- name: user2
    token: NjNhMjM5MTgtMzg5Yy00YWVjLWE2ZTUtMDg5MzA4MzQ3YmE4

7. Will raise up that the user dose not have a project

Expected results:
5. The action should be failed or not, but the warning message that the current project has been deleted should be shown.

Additional info:

Comment 1 Fabiano Franz 2015-03-17 21:52:05 UTC
(In reply to Meng Bo from comment #0)
> 4. Delete the project via admin
> # osc delete project project21
> 5. Try to get/delete/create the pods via the user2
> $ osc get po
> $ osc delete po --all
> $ osc create po -f pod.json

> 5. All the actions work

Could you confirm if still succeeds after waiting a few minutes? I *think* this may be related to project caching.

Comment 2 Fabiano Franz 2015-03-17 21:57:22 UTC
Derek, could you confirm why this happens?

1. Create project 'foo'
2. Create pod when project 'foo' is active
3. List pods when project 'foo' is active, succeeds listing the pod created in 2
4. Delete project created in 1
5. List pods, still succeeds listing the pod created in 2

Is it because of caching, or because after the project gets deletes we still keep the namespace (to which the pod is related)?

Comment 3 Meng Bo 2015-03-18 07:05:14 UTC
Hi Fabiano,

I have tried to wait about 10 minutes after the project deleted, the user still can list the pod.

Comment 4 Fabiano Franz 2015-03-18 14:57:55 UTC
I spoke with Derek, basically the expectation is that when you delete a project , all the content in that project gets deleted. But that's not implemented yet, will be part of the following story:


The flow will be something like you delete a project, it goes into a terminating phase, and then all your stuff is deleted, and once all the stuff is deleted, your project is finally purged from storage.

There is a PR for Kubernetes already and there will be one for Origin:


So not exactly a bug, I think we should close it and handle this in the Trello card.

Comment 5 Meng Bo 2015-03-20 06:43:31 UTC
Close the bug and use the trello card to track the feature.

Note You need to log in before you can comment on or make changes to this bug.