ApplyPatches applies the patches to the config if defined
(data map[string]interface{}, profile *latest.ProfileConfig)
| 213 | |
| 214 | // ApplyPatches applies the patches to the config if defined |
| 215 | func ApplyPatches(data map[string]interface{}, profile *latest.ProfileConfig) (map[string]interface{}, error) { |
| 216 | if profile == nil || len(profile.Patches) == 0 { |
| 217 | return data, nil |
| 218 | } |
| 219 | |
| 220 | return ApplyPatchesOnObject(data, profile.Patches) |
| 221 | } |
| 222 | |
| 223 | func ApplyPatchesOnObject(data map[string]interface{}, configPatches []*latest.PatchConfig) (map[string]interface{}, error) { |
| 224 | out, err := yaml.Marshal(data) |