1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-13 19:28:55 +00:00

fix: exclude user names in configmap not working (#6204)

Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
This commit is contained in:
Charles-Edouard Brétéché 2023-02-02 19:12:36 +01:00 committed by GitHub
parent 8b80fe82d4
commit 48eb79d288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -28,6 +28,11 @@ func (inner AdmissionHandler) withFilter(c config.Configuration) AdmissionHandle
if c.ToFilter(request.Kind.Kind, request.Namespace, request.Name) {
return nil
}
for _, username := range c.GetExcludeUsername() {
if request.UserInfo.Username == username {
return nil
}
}
if webhookutils.ExcludeKyvernoResources(request.Kind.Kind) {
return nil
}