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:
parent
9834feea74
commit
944bf1728e
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue