mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-30 03:15:05 +00:00
786 tested prototype
This commit is contained in:
parent
b3b715c526
commit
49e26aface
1 changed files with 10 additions and 2 deletions
|
@ -30,9 +30,17 @@ func SubstituteVars(log logr.Logger, ctx context.EvalInterface, pattern interfac
|
|||
func subVars(log logr.Logger, ctx context.EvalInterface, pattern interface{}, path string, errs *[]error) interface{} {
|
||||
switch typedPattern := pattern.(type) {
|
||||
case map[string]interface{}:
|
||||
return subMap(log, ctx, typedPattern, path, errs)
|
||||
mapCopy := make(map[string]interface{})
|
||||
for k, v := range typedPattern {
|
||||
mapCopy[k] = v
|
||||
}
|
||||
|
||||
return subMap(log, ctx, mapCopy, path, errs)
|
||||
case []interface{}:
|
||||
return subArray(log, ctx, typedPattern, path, errs)
|
||||
sliceCopy := make([]interface{}, len(typedPattern))
|
||||
copy(sliceCopy, typedPattern)
|
||||
|
||||
return subArray(log, ctx, sliceCopy, path, errs)
|
||||
case string:
|
||||
return subValR(log, ctx, typedPattern, path, errs)
|
||||
default:
|
||||
|
|
Loading…
Add table
Reference in a new issue