Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Detect if the user to init on Tenant already has a project on OSO #1446

Open
xcoulon opened this issue Nov 22, 2017 · 3 comments
Open

Detect if the user to init on Tenant already has a project on OSO #1446

xcoulon opened this issue Nov 22, 2017 · 3 comments

Comments

@xcoulon
Copy link
Collaborator

xcoulon commented Nov 22, 2017

Goal is to verify that the user to init on Tenant has no project on OSO prior to using OSIO, otherwise it would cause some problems during the tenant initialization (unable to create a new project in his account due to quota limits).
This verification could be done during the init (in which case, there would be an error returned if the user already has a project), or before, which requires a new endpoint

Parent Experience

#2129 Handling of pre-existing OpenShift Online Starter artifacts for new OpenShift.io users

@aslakknutsen
Copy link
Collaborator

API Draft/Flow discussed with UI @dgutride

POST /api/user/services

    409 Conflict 
        data.attributes
            msg: string
            quota: int
            namespaces: [
                "conflicted_namespace"
            ] 
        links
            delete: some_url

DELETE "links.delete"

    200 Ok

I think if you call POST again after DELETE, POST 'should' return 202 Accepted and the async init is in progress

GET /api/user/services

    200 OK

    this should contain the status etc if needed.

@aslakknutsen
Copy link
Collaborator

@joshuawilson
Copy link
Member

what is the status on this?

xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 2, 2018
…IO#1446)

Include option in User service to support custom HTTP transport
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`)
Add test on the controller.TenantController.Setup() method using go-vcr

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
@joshuawilson joshuawilson removed this from the Sprint 145 milestone Mar 6, 2018
@joshuawilson joshuawilson added this to the Sprint 146 milestone Mar 6, 2018
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 8, 2018
…IO#1446)

Include option in User service to support custom HTTP transport
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`)
Add test on the controller.TenantController.Setup() method using go-vcr

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 8, 2018
…IO#1446)

Include option in User service to support custom HTTP transport
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`)
Add test on the controller.TenantController.Setup() method using go-vcr
Add a function in `openshift` pkg to retrieve the name of the user's projects (and factorize
the code to perform the GET request on the Openshift API endpoint)

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 9, 2018
…IO#1446)

Add function to list projects on OSO for the user, given his/her OSO token.
Check that there's no project, or a single project named after the user.
Include option in User service to support custom HTTP transport.
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`).
Add test on the controller.TenantController.Setup() method using `go-vcr`.
Add a function in `openshift` pkg to retrieve the name of the user's projects (and factorize
the code to perform the GET request on the Openshift API endpoint).

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 9, 2018
…IO#1446)

Add function to list projects on OSO for the user, given his/her OSO token.
Check that there's no project, or a single project named after the user.
Include option in User service to support custom HTTP transport.
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`).
Add test on the controller.TenantController.Setup() method using `go-vcr`.
Add a function in `openshift` pkg to retrieve the name of the user's projects (and factorize
the code to perform the GET request on the Openshift API endpoint).

Also: use encoded token in the go-vcr recording for TestResolveServiceAccountToken

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 9, 2018
…IO#1446)

Add function to list projects on OSO for the user, given his/her OSO token.
Check that there's no project, or a single project named after the user.
Include option in User service to support custom HTTP transport.
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`).
Add test on the controller.TenantController.Setup() method using `go-vcr`.
Add a function in `openshift` pkg to retrieve the name of the user's projects (and factorize
the code to perform the GET request on the Openshift API endpoint).

Also: use encoded token in the go-vcr recording for TestResolveServiceAccountToken

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
xcoulon added a commit to xcoulon/fabric8-tenant that referenced this issue Mar 9, 2018
…IO#1446)

Add function to list projects on OSO for the user, given his/her OSO token.
Check that there's no project,  otherwise, clean/remove all user's namespaces.
Include option in User service to support custom HTTP transport.
Rename vars in controller.Tenant to avoid collision with packages (`user` and `cluster`).
Add test on the controller.TenantController.Setup() method using `go-vcr`.
Add a function in `openshift` pkg to retrieve the name of the user's projects (and factorize
the code to perform the GET request on the Openshift API endpoint).

Also: use encoded token in the go-vcr recording for TestResolveServiceAccountToken

Fixes openshiftio/openshift.io#1446

Signed-off-by: Xavier Coulon <[email protected]>
@joshuawilson joshuawilson modified the milestones: Sprint 146, Sprint 147 Mar 27, 2018
@xcoulon xcoulon modified the milestones: Platform Backlog, Sprint 149 May 14, 2018
@joshuawilson joshuawilson modified the milestones: Sprint 149, Sprint 150 May 29, 2018
@joshuawilson joshuawilson modified the milestones: Sprint 150, Sprint 151 Jun 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants