mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-18 02:06:52 +00:00
fix check for background mode
This commit is contained in:
parent
3dfe3169dc
commit
4c47d40a3c
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ func Validate(policyRaw []byte, client *dclient.Client, mock bool, openAPIContro
|
|||
if path, err := validateUniqueRuleName(p); err != nil {
|
||||
return fmt.Errorf("path: spec.%s: %v", path, err)
|
||||
}
|
||||
if p.Spec.Background == nil || *p.Spec.Background == false {
|
||||
if p.Spec.Background == nil || *p.Spec.Background == true {
|
||||
if err := ContainsVariablesOtherThanObject(p); err != nil {
|
||||
return fmt.Errorf("only select variables are allowed in background mode. Set spec.background=false to disable background mode for this policy rule. %s ", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue