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

Cloned namespaces do not get put in the same project #7231

Closed
gaktive opened this issue Oct 19, 2022 · 1 comment · Fixed by #7271
Closed

Cloned namespaces do not get put in the same project #7231

gaktive opened this issue Oct 19, 2022 · 1 comment · Fixed by #7271

Comments

@gaktive
Copy link
Member

gaktive commented Oct 19, 2022

Internal reference: SURE-5408
Reported in 2.6.7

When a user tries to "clone" a namespace (ns 1) in the UI, it does not clone the metadata annotation that sets the project that the namespace (ns 1) it is cloning is in. Therefore, after creating the namespace (ns 2), users who only have access to the project of the namespace (ns 1) they cloned can no longer see the cloned namespace (ns 2) and cannot move it to the project that they have access to.

Troubleshooting steps:

When copying the namespace, a user can edit the YAML and paste in the annotation containing the projectId of the project they would like assigned. EX:

metadata:
  annotations:
    field.cattle.io/projectId: c-m-xxxxxxx-yyyyy

Repro steps:

  • On fresh install
  • Create Standard User
  • Add as Project Owner
  • Create test namespace
  • Clone test namespace
  • The cloned namespace is put in "not in a project", but user can see it.
  • The user tries to move the namespace to the project they have access to, but it errors out.
  • If the user refreshes or logs out/in they can no longer see the cloned namespace.

Workaround:

When copying the namespace, a user can edit the YAML and paste in the annotation containing the projectId of the project they would like assigned, like so:

metadata:
  annotations:
    field.cattle.io/projectId: c-m-xxxxxxx-yyyyy

Actual behavior:

Cloned namespace does not clone the project of the namespace being cloned.

Expected behavior:

Cloned namespace is placed in the same project as the namespace being cloned.

@anupama2501
Copy link

Reproduced on v2.7.0:

  • Create a rancher server on v2.7.0
  • Create 2 standard users - u1 and u2
  • As u1, create a downstream rke1 or rke2 cluster - cluster type does not matter.
  • Add u2 as a cluster member in the downstream clusters.
  • As u2, create 2 projects P1 and P2
  • In P1, create a namespace ns1
  • From ns1, clone a new namespace - cloned ns gets created in Not in a project
  • Move the ns from Not in a project to the project P1
  • Throws a forbidden error as the project owner does not have access to Not in a project

Verified on v2.7-head 2b2ed44

  • Create a rancher server on v2.7.0
  • Create 2 standard users - u1 and u2
  • As u1, create a downstream rke1 or rke2 cluster - cluster type does not matter.
  • Add u2 as a cluster member in the downstream clusters.
  • As u2, create 2 projects P1 and P2
  • In P1, create a namespace ns1
  • From ns1, clone a new namespace - cloned ns gets created in project P1
    Repeated the above steps as a cluster member and works as expected.

Note:
If we move any namespace from one project to another project as a cluster member/project owner - unable to create deployments in that namespace as mentioned in the linked ticket above.

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

Successfully merging a pull request may close this issue.

4 participants