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

Fix in clearing space fields of config data on cf space-delete #309

Merged
merged 1 commit into from
Dec 18, 2014

Conversation

shashidharatd
Copy link

Before Fix: If cf user deleting the targeted space but with space name as
case insenstive then space fields are not deleted from the config
htipl@cf5:/go/src/github.com/cloudfoundry/cli$ cf spaces
Getting spaces in org SriniOrg as admin...
name
No spaces found
htipl@cf5:
/go/src/github.com/cloudfoundry/cli$ cf target
API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: SriniSpace

After Fix:If cf user does same steps
space fields are deleted from the config
htipl@cf5:/go/src/github.com/cloudfoundry/cli$ ./out/cf spaces
Getting spaces in org SriniOrg as admin...
name
No spaces found
htipl@cf5:
/go/src/github.com/cloudfoundry/cli$ ./out/cf target
API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: No space targeted, use 'cf target -s SPACE'

Before Fix: If cf user deleting the targeted space but with space name as
case insenstive then space fields are not deleted from the config
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf spaces
Getting spaces in org SriniOrg as admin...
name
No spaces found
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf target
API endpoint:   https://api.10.244.0.34.xip.io (API version: 2.13.0)
User:           admin
Org:            SriniOrg
Space:          SriniSpace

After Fix:If cf user does same steps
space fields are deleted from the config
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ ./out/cf spaces
Getting spaces in org SriniOrg as admin...
name
No spaces found
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ ./out/cf target
API endpoint:   https://api.10.244.0.34.xip.io (API version: 2.13.0)
User:           admin
Org:            SriniOrg
Space:          No space targeted, use 'cf target -s SPACE'

http://rnd-github.huawei.com/paas/cli/issues/28
@cfdreddbot
Copy link

Hey shashidharatd!

Thanks for submitting this pull request! I'm here to inform the recipients of the pull request that you've already signed the CLA.

@cf-gitbot
Copy link

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/83828548.

@goehmen
Copy link
Contributor

goehmen commented Dec 8, 2014

@shashidharatd Can you explain this a bit more. I don't think your example show a cf delete-space command so it is hard to understand the whole issue

@SrinivasChilveri
Copy link

Hi @goehmen

The Basic issue is after deleting the space spacename(cf delete-space spacename) here the actual spacename is like SriniSpace but while deleting the space name we are giving case insenstive space name srinispace (all small letters instead of capital letter of S) cf delete-space srinispace then space is deleted properly but not the config data, so because of that if cf user does cf target still its showing

API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: SriniSpace // but this space is not there.

As shown below the org names & spaces name are case insenstive so SriniOrg ,sriniorg are same SriniSpace srinispace also same & the creation & deletion behaves properly but during cf delete-space the config data is not cleard properly.
if you see below SriniSpace, TempSpace are there & target is SriniOrg & SriniSpace.
but deleted the sapec by cf delete-space srinispace
then if we see the spaces then only TempSpace is there but if we see the target by cf target then its showing as
API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: SriniSpace // but this space is not there.

htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf target

API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: SriniSpace
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf orgs
Getting orgs as admin...

name
SriniOrg
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf spaces
Getting spaces in org SriniOrg as admin...

name
SriniSpace
TempSpace
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf delete-space srinispace

Really delete the space srinispace?> y
Deleting space srinispace in org SriniOrg as admin...
OK
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf spaces
Getting spaces in org SriniOrg as admin...

name
TempSpace
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$ cf target

API endpoint: https://api.10.244.0.34.xip.io (API version: 2.13.0)
User: admin
Org: SriniOrg
Space: SriniSpace
htipl@cf5:~/go/src/github.com/cloudfoundry/cli$

@SrinivasChilveri
Copy link

Hi @goehmen Do you need any more information ?

simonleung8 pushed a commit that referenced this pull request Dec 18, 2014
Fix in clearing space fields of config data on cf space-delete
@simonleung8 simonleung8 merged commit 364a89e into cloudfoundry:master Dec 18, 2014
@simonleung8
Copy link
Contributor

It looks good to us. merging.
Thanks for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants