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

fixed permissions errors when applying multiple namespaces #183

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

paynejacob
Copy link
Contributor

rancher/rancher#34712

Problem

When users try to modify resources in multiple namespaces wrangler attempts to list them across all namespaces. Most users do not have permission to list resources across all namespaces and an error is returned.

Solution

When applying resources gather what namespaces will be affected make multiple searches across the specified namespaces.

Testing

I tested this and confirmed users will still see permission errors if they attempt to create a resource in a namespace that they do not have access to. I also tested creating resources that are not namespaced with a user that has access to them.

Copy link
Contributor

@snasovich snasovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a quick review, couple minor comments. Will try to review again later.

Copy link
Contributor

@cmurphy cmurphy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see tests here! Would be nice if there was also a drone job to run them automatically. I ran them locally and at least the new ones seem to work.

Copy link
Contributor

@snasovich snasovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kudos for adding tests for this!
Have a couple of additional comments though, apologies for not sending them with the first review.

Copy link
Contributor

@snasovich snasovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One trivial thing to fix

assert.NoError(t, err)
}

if tt.expectedCalls > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be >= to fully validate the first test case.

Copy link
Contributor

@snasovich snasovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@kinarashah kinarashah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on adding tests! 🎉 🥇

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.

5 participants