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

fix: Use the matchMode specified in the rbac configmap #9419

Merged
merged 2 commits into from Jun 2, 2022

Conversation

chetan-rns
Copy link
Member

@chetan-rns chetan-rns commented May 16, 2022

Read the matchMode field from the argocd-rbac-cm before checking the policy

Closes: #9363

Signed-off-by: Chetan Banavikalmutt chetanrns1997@gmail.com

Note on DCO:

If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • Optional. My organization is added to USERS.md.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).

@codecov
Copy link

codecov bot commented May 16, 2022

Codecov Report

Merging #9419 (5a77f3e) into master (2a69038) will increase coverage by 0.00%.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##           master    #9419   +/-   ##
=======================================
  Coverage   45.86%   45.87%           
=======================================
  Files         221      221           
  Lines       26309    26311    +2     
=======================================
+ Hits        12067    12069    +2     
  Misses      12586    12586           
  Partials     1656     1656           
Impacted Files Coverage Δ
cmd/argocd/commands/admin/settings_rbac.go 24.06% <66.66%> (+0.82%) ⬆️
util/settings/settings.go 48.16% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95f0624...5a77f3e. Read the comment docs.

@crenshaw-dev
Copy link
Collaborator

@chetan-rns looks like a pretty important bugfix. Do you think it should be cherry-picked to 2.4?

Copy link
Member

@ishitasequeira ishitasequeira left a comment

Choose a reason for hiding this comment

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

@chetan-rns The PR LGTM!

A minor comment, should we add a test case for below scenarios too?

  • match mode = "glob" , and we pass in a regex
  • match mode = "regex", and we pass in a glob

@chetan-rns
Copy link
Member Author

@crenshaw-dev I don't have a strong opinion about cherry picking, since the bug only affects the admin settings rbac can command. Regex match mode still works fine when invoked in the argocd server.

@crenshaw-dev
Copy link
Collaborator

Ah gotcha. Let's let it wait for 2.5 then.

@crenshaw-dev
Copy link
Collaborator

@chetan-rns just checking in on this one. Will you have a chance to add tests?

Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
Signed-off-by: Chetan Banavikalmutt <chetanrns1997@gmail.com>
@chetan-rns
Copy link
Member Author

@crenshaw-dev I've included unit tests. PTAL

Copy link
Collaborator

@crenshaw-dev crenshaw-dev left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@crenshaw-dev crenshaw-dev merged commit 89346fa into argoproj:master Jun 2, 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.

RBAC Regex Validation Issues
3 participants