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

Remove unneeded API call to get projects from local cluster #6529

Merged
merged 1 commit into from
Aug 3, 2022

Conversation

catherineluse
Copy link
Contributor

@catherineluse catherineluse commented Jul 27, 2022

I was able to debug #6464 after logging into Anu's setup.

The error was caused by the fact that the cluster member did not have permission to list projects using the Steve API:

projects.management.cattle.io "p-6rkkp" is forbidden: User "u-w9kcq" cannot get resource "projects" in API group "management.cattle.io" in the namespace "c-6jf6l"

The culprit was this line of code, which attempts to refetch all projects immediately after creating a project. It requires admin access to be able to list resources in the local cluster:

await this.$dispatch('management/findAll', { type: MANAGEMENT.PROJECT, opt: { force: true } }, { root: true });

I believe the line is unnecessary because I created several projects as the cluster member and the Projects/namespaces list view was updated every time to show the newly created project.

@nwmac nwmac added this to the v2.6.7 milestone Jul 28, 2022
@richard-cox
Copy link
Member

Before this goes in, we need to validate with fixes from #6565

@catherineluse
Copy link
Contributor Author

catherineluse commented Aug 2, 2022

The findAll projects here was redundant because it was being called both in the projects/namespaces list page and in the project model.

The one that my PR deletes is the newer one, and it was last changed 10 months ago (570c465#diff-1c5f58ff28a280df24b9aada53d5e79411849100fb65ba4ea65054cad814fcb4, not sure when it was added).

@catherineluse catherineluse merged commit c933a9a into rancher:master Aug 3, 2022
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.

4 participants