(expected, current string)
| 2313 | } |
| 2314 | |
| 2315 | func composeEqualExceptImage(expected, current string) (bool, error) { |
| 2316 | expectedCompose := make(map[string]interface{}) |
| 2317 | if err := yaml.Unmarshal([]byte(expected), &expectedCompose); err != nil { |
| 2318 | return false, err |
| 2319 | } |
| 2320 | currentCompose := make(map[string]interface{}) |
| 2321 | if err := yaml.Unmarshal([]byte(current), ¤tCompose); err != nil { |
| 2322 | return false, err |
| 2323 | } |
| 2324 | removeComposeServiceImages(expectedCompose) |
| 2325 | removeComposeServiceImages(currentCompose) |
| 2326 | return reflect.DeepEqual(expectedCompose, currentCompose), nil |
| 2327 | } |
| 2328 | |
| 2329 | func removeComposeServiceImages(composeMap map[string]interface{}) { |
| 2330 | services, ok := composeMap["services"].(map[string]interface{}) |
no test coverage detected