mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-05 15:37:19 +00:00
NK-31: Fixed compilation
This commit is contained in:
parent
6845b48068
commit
040ea99f41
1 changed files with 8 additions and 12 deletions
|
@ -186,17 +186,13 @@ func serializePatch(patch types.PolicyPatch) ([]byte, error) {
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
processedPatchValue, err := processPatchValue(patch.Value)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
} else {
|
||||
|
||||
patch = types.PolicyPatch{
|
||||
Path: patch.Path,
|
||||
Operation: patch.Operation,
|
||||
Value: processedPatchValue,
|
||||
Value: processPatchValue(patch.Value),
|
||||
}
|
||||
return json.Marshal(patch)
|
||||
}
|
||||
}
|
||||
|
||||
// Recursively converts all numbers to strings in JSONPatch value.
|
||||
|
@ -206,9 +202,9 @@ func processPatchValue(value interface{}) interface{} {
|
|||
for k, v := range interfaceMap {
|
||||
newMap[k] = processPatchValue(v)
|
||||
}
|
||||
return newMap, nil
|
||||
return newMap
|
||||
} else {
|
||||
return fmt.Sprintf("%v", value), nil
|
||||
return fmt.Sprintf("%v", value)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue