Commit b5ea847
committed
Fix amIAdmin function to correctly check admin group membership
The amIAdmin function had a logic bug where it was checking if a single
group name existed in the user's group list, rather than checking if any
of the user's groups matched the allowed admin groups. This caused the
webhook to incorrectly deny requests from users in the cluster-admins group.
This fixes the e2e test failures in openshift/origin endpoint admission tests
where the admin client was being denied access to privileged namespaces.
OCPBUGS-626421 parent 3031ecc commit b5ea847
1 file changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
324 | | - | |
325 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
326 | 328 | | |
327 | | - | |
328 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
329 | 332 | | |
330 | 333 | | |
| 334 | + | |
331 | 335 | | |
332 | 336 | | |
333 | | - | |
334 | | - | |
| 337 | + | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
338 | | - | |
| 341 | + | |
339 | 342 | | |
0 commit comments