1
0
Fork 0
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:
belyshevdenis 2019-03-12 14:53:32 +02:00
parent 6845b48068
commit 040ea99f41

View file

@ -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)
}
}