-
Notifications
You must be signed in to change notification settings - Fork 38
fix: tighten the VAP rule for all managed resources #1212
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
Conversation
ae2114c to
8b3fada
Compare
Signed-off-by: Nont <nont@duck.com>
8b3fada to
840e808
Compare
| // Verify initial state | ||
| if vap == nil { | ||
| t.Fatal("getVAPWithMutator() returned nil VAP") | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprised this is needed - I thought t.Fatal() will not execute further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I got a lint error/warning from not having this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't remember what it was that gave this warning/error, but I have gone ahead and remove this from it. Let's see if I'm going to get a lint error from the checks.
Signed-off-by: Nont <nont@duck.com>
Signed-off-by: Nont <nont@duck.com>
| "system:masters" in request.userInfo.groups || | ||
| "system:serviceaccounts:kube-system" in request.userInfo.groups || | ||
| "system:serviceaccounts:fleet-system" in request.userInfo.groups || | ||
| "system:serviceaccounts:openshift-kube-controller-manager" in request.userInfo.groups |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| "system:serviceaccounts:openshift-kube-controller-manager" in request.userInfo.groups |
You can remove this condition since the new condition added below should properly handle OCP clusters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That clause is now removed, so is the || operator before it.
Signed-off-by: Nont <nont@duck.com>
Description of your changes
Fixes # bug that the VAP can be deleted and enhanced it so that it covers all managed resources.
I have:
make reviewableto ensure this PR is ready for review.How has this code been tested
Tested with unit tests and e2e locally.
Special notes for your reviewer
n/a