This repository was archived by the owner on Nov 14, 2024. It is now read-only.
Merged
Conversation
…thorizationv1client
|
This pull request has been linked to Clubhouse Story #15968: Checks for RBAC permissions. |
jawnsy
reviewed
Aug 21, 2021
jawnsy
reviewed
Aug 21, 2021
jawnsy
reviewed
Aug 21, 2021
| - pkg: k8s.io/client-go/kubernetes/typed/authorization/(v[\w\d]+) | ||
| - pkg: k8s.io/api/authorization/(v[\w\d]+) | ||
| alias: authorization$1 | ||
| - pkg: k8s.io/client-go/kubernetes/typed/authorization/(v[\w\d]+) |
There was a problem hiding this comment.
Ahh, it's kinda unfortunate that we have to import a bunch of these this way, but makes sense to me!
jawnsy
reviewed
Aug 21, 2021
jawnsy
reviewed
Aug 21, 2021
jawnsy
reviewed
Aug 21, 2021
jawnsy
reviewed
Aug 21, 2021
jawnsy
approved these changes
Aug 23, 2021
| func (k *KubernetesChecker) CheckRBAC(ctx context.Context) []*api.CheckResult { | ||
| const checkName = "kubernetes-rbac" | ||
| authClient := k.client.AuthorizationV1() | ||
| rbacReqs := findClosestVersionRequirements(k.coderVersion) |
There was a problem hiding this comment.
Not important to do now, can do this as another PR -- can we check this in the Validate step, so that these errors are impossible? The idea is that only server errors or genuine failures should cause FAIL results, bad input should be caught before anything runs (calling code should call Validate, check for errors, and then Run)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR adds the capability to check if the current cluster context has the required permissions for Coder.
Note: I ran into a strange issue withimportasalerting forauthorizationv1client; I disabled this check for the moment.Edit: worked around this.
Basing this PR against a different branch until it is merged, and will then rebase onto main.