fix(server): don't grab SAs if SSO RBAC is not enabled #11426
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes argoproj/argo-helm#2159, Fixes argoproj/argo-helm#1624
Motivation
ResourceCache
creates aServiceAccountLister
informer
, but this is only used when RBAC is enabledClusterRole
should not requireserviceaccount
permissionsClusterRole
will requireserviceaccount
permissions, despite not actually needing it (i.e. not "least privilege")Modifications
ResourceCache
when SSO RBAC is enabledVerification
There's no unit tests for this specific file / for the
NewArgoServer
function. I might be able to write an E2E test for this, but am still learning that part of the codebase.rbac.enabled: true
. Then running a subset of the Server E2E tests. Non-trivial change as far as I can tell so far, and may require a decent bit of modifications to theMakefile
etc to run a new test + install a new manifest as well 😅Future Work
I feel like it might make sense to rename / move
resource_cache.go
? It is only used by SSO RBAC and nothing else right now, as far as I can tell. The name feels misleading as a result as it seems more generic.