@@ -2246,10 +2246,39 @@ func isEditCompose(installed model.AppInstall) bool {
22462246 if rawCompose == "" || err != nil {
22472247 return false
22482248 }
2249- if rawCompose != installed .DockerCompose {
2250- return true
2249+ equal , err := composeEqualExceptImage (rawCompose , installed .DockerCompose )
2250+ if err != nil {
2251+ return false
2252+ }
2253+ return ! equal
2254+ }
2255+
2256+ func composeEqualExceptImage (expected , current string ) (bool , error ) {
2257+ expectedCompose := make (map [string ]interface {})
2258+ if err := yaml .Unmarshal ([]byte (expected ), & expectedCompose ); err != nil {
2259+ return false , err
2260+ }
2261+ currentCompose := make (map [string ]interface {})
2262+ if err := yaml .Unmarshal ([]byte (current ), & currentCompose ); err != nil {
2263+ return false , err
2264+ }
2265+ removeComposeServiceImages (expectedCompose )
2266+ removeComposeServiceImages (currentCompose )
2267+ return reflect .DeepEqual (expectedCompose , currentCompose ), nil
2268+ }
2269+
2270+ func removeComposeServiceImages (composeMap map [string ]interface {}) {
2271+ services , ok := composeMap ["services" ].(map [string ]interface {})
2272+ if ! ok {
2273+ return
2274+ }
2275+ for _ , service := range services {
2276+ serviceMap , ok := service .(map [string ]interface {})
2277+ if ! ok {
2278+ continue
2279+ }
2280+ delete (serviceMap , "image" )
22512281 }
2252- return false
22532282}
22542283
22552284func getAppVersions (key string , details []model.AppDetail ) []string {
0 commit comments