(value any)
| 103 | } |
| 104 | |
| 105 | func toValidJSON(value any) (any, error) { |
| 106 | var v any |
| 107 | j, err := json.Marshal(value) |
| 108 | if err != nil { |
| 109 | return nil, errors.Wrap(err, "cannot marshal value to JSON") |
| 110 | } |
| 111 | if err := json.Unmarshal(j, &v); err != nil { |
| 112 | return nil, errors.Wrap(err, "cannot unmarshal value from JSON") |
| 113 | } |
| 114 | return v, nil |
| 115 | } |
| 116 | |
| 117 | // toMergeOption returns the MergeOptions from the PatchPolicy's ToFieldPathPolicy, if defined. |
| 118 | func toMergeOption(p PatchInterface) (mo *xpv1.MergeOptions, err error) { |
no outgoing calls
no test coverage detected