mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-29 10:55:05 +00:00
substitute variable values on a copy of policy rule (#669)
This commit is contained in:
parent
ad9d82b215
commit
2bba55e211
1 changed files with 4 additions and 1 deletions
|
@ -266,7 +266,10 @@ func handleData(ruleName string, generateRule kyverno.Generation, client *dclien
|
|||
return nil, NewViolation(ruleName, fmt.Errorf("path not present in generate data: %s", invalidPaths))
|
||||
}
|
||||
|
||||
newData := variables.SubstituteVariables(ctx, generateRule.Data)
|
||||
//work on copy
|
||||
copyDataTemp := reflect.Indirect(reflect.ValueOf(generateRule.Data))
|
||||
copyData := copyDataTemp.Interface()
|
||||
newData := variables.SubstituteVariables(ctx, copyData)
|
||||
|
||||
// check if resource exists
|
||||
obj, err := client.GetResource(generateRule.Kind, generateRule.Namespace, generateRule.Name)
|
||||
|
|
Loading…
Add table
Reference in a new issue