mirror of
https://github.com/kyverno/kyverno.git
synced 2024-12-14 11:57:48 +00:00
CR fixes
This commit is contained in:
parent
3fbfa251ad
commit
eec0decae7
2 changed files with 1 additions and 4 deletions
|
@ -80,17 +80,14 @@ func subVal(ctx context.EvalInterface, valuePattern interface{}, path string, er
|
|||
// default or operator.Equal
|
||||
// equal + string value
|
||||
// object variable
|
||||
valuePattern = value
|
||||
return value
|
||||
}
|
||||
// operator + string variable
|
||||
switch value.(type) {
|
||||
case string:
|
||||
valuePattern = string(operatorVariable) + value.(string)
|
||||
return string(operatorVariable) + value.(string)
|
||||
default:
|
||||
glog.Infof("cannot use operator with object variables. operator used %s in pattern %v", string(operatorVariable), valuePattern)
|
||||
valuePattern = emptyInterface
|
||||
return emptyInterface
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ func ContainsUserInfo(policy kyverno.ClusterPolicy) error {
|
|||
return fmt.Errorf("userInfo variable used at spec/rules[%d]/validate/pattern", idx)
|
||||
}
|
||||
for idx2, pattern := range rule.Validation.AnyPattern {
|
||||
if pattern, err = variables.SubstituteVars(ctx, pattern); err != nil {
|
||||
if rule.Validation.AnyPattern[idx2], err = variables.SubstituteVars(ctx, pattern); err != nil {
|
||||
return fmt.Errorf("userInfo variable used at spec/rules[%d]/validate/anyPattern[%d]", idx, idx2)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue