openshiftio / openshift.io

Red Hat OpenShift.io is an end-to-end development environment for planning, building and deploying modern applications.
https://openshift.io
97 stars 66 forks source link

Pipeline builds overlap between spaces when project name is the same #4184

Open pmacik opened 6 years ago

pmacik commented 6 years ago
Issue Overview

Pipeline builds overlap between spaces when project name is the same

Expected Behaviour

When a user creates a new project (using launcher) in different spaces the pipeline builds for each project should be isolated from each other completely - different pipelines should be triggered, one per project.

Current Behaviour

When user creates a new project in one space with the same name as an existing project in a different space, the additional build of the same pipeline is triggered instead of a new one.

Steps To Reproduce
  1. Create a new space space1
  2. Under space1 create an application test123 using launcher (rest-http, vert.x, rollout-to-run) with git repository name space1-test123
  3. Watch for the pipeline build in space1 to start (test123/Build #1)
  4. Create a second space space2
  5. Under space2 create an application with the same name test123 using launcher (rest-http, vert.x, rollout-to-run) with git repository name space2-test123
  6. Watch for the pipeline build in space2 to start:
  1. Watch for the build pipeline in space1:
Additional Information

User: pmacik@redhat.com Cluster: starter-us-east-2

piyush-garg commented 6 years ago

@pmacik

You can not create two pipelines with the same name in a single namespace. Basically, the application name is the name of the build config.

pmacik commented 6 years ago

@piyush1594 I'm not trying to create two pipelines with the same name in a single namespace.

I do try to create one pipeline in each of the two spaces while the name of the pipeline (project) is the same:

Space space1:

Space space2:

I expect that the 2 pipelines are separated but they are not.

piyush-garg commented 6 years ago

@pmacik You are getting confused between space and namespace.

Space in OSIO is a different thing. All the pipelines you create in any space in OSIO will actually get created in a single namespace in OSO(openshift) that is your username of OSIO.

And you can not create two pipelines with the same name in openshift basically any resource like pod, deployment config etc.

Thanks

pmacik commented 6 years ago

@piyush1594 Ah, I understand, now... Thanks.

But, in that case, OSIO should not allow a user to create a project with the existing name within the namespace. But it does.

Is that intentional?

piyush-garg commented 6 years ago

There is a check for duplicate project name in the same space. I think we need to add it for all spaces.

same-project

@bartoszmajsak or @vikram-raj can provide more details about that.

vikram-raj commented 6 years ago

Yes, there is a check for the project name in the same space in which the user is.

piyush-garg commented 6 years ago

@pmacik I think this is not a build team issue. Feel free to put label again if you find so. Adding app creation team label.

jiekang commented 6 years ago

I think having two different spaces with projects with the same name should work. The underlying system should preferably use a hash id instead of a name, otherwise it can use a combination of space + project name.

joshuawilson commented 6 years ago

@alexeykazakov what do you think about using a hash ID instead of the name? We might be able to do that in the UI. Just thinking it should be set in backend to be safer.

alexeykazakov commented 6 years ago

Yeah.. there are other places were we hit some OCP/k8s limitations in resource naming. Properly fixing it on the backend side will take some time (don't expect it to be fixed soon), so I would add some validation in UI for now.

joshuawilson commented 6 years ago

we can each plan to include it