1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-30 19:35:06 +00:00
Signed-off-by: Mario Vazquez <mavazque@redhat.com>

Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
Mario Vázquez 2022-04-08 16:54:35 +02:00 committed by GitHub
parent 9834feea74
commit 944bf1728e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -103,8 +103,8 @@ func (v *Validate) validateForEach(foreach *kyverno.ForEachValidation) error {
return fmt.Errorf("foreach.list is required")
}
if !strings.HasPrefix(foreach.List, "request.object") {
return fmt.Errorf("foreach.list must start with 'request.object' e.g. 'request.object.spec.containers'")
if !strings.HasPrefix(foreach.List, "request.object") && !strings.HasPrefix(foreach.List, "request.userInfo") {
return fmt.Errorf("foreach.list must start with either 'request.object' or 'request.userInfo', e.g. 'request.object.spec.containers', 'request.userInfo.groups'")
}
count := foreachElemCount(foreach)