Fix image comparison when running intermediate targets with depends_on

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2018-01-23 09:11:59 -08:00
parent 8956fc1e5a
commit 2b223f55fa
2 changed files with 3 additions and 3 deletions

View File

@ -597,7 +597,7 @@ module.exports = class ApplicationManager extends EventEmitter
if target.dependsOn?
for dependency in target.dependsOn
dependencyService = _.find(targetApp.services, (s) -> s.serviceName == dependency)
if !_.find(availableImages, (image) => @images.isSameImage(image, { name: dependencyService.imageName }))?
if !_.find(availableImages, (image) => image.dockerImageId == dependencyService.image or @images.isSameImage(image, { name: dependencyService.imageName }))?
return false
return true

View File

@ -258,8 +258,8 @@ module.exports = class Images extends EventEmitter
@imageCleanupFailures[image] = Date.now()
@hasSameDigest: (name1, name2) ->
hash1 = name1.split('@')[1]
hash2 = name2.split('@')[1]
hash1 = name1?.split('@')[1]
hash2 = name2?.split('@')[1]
return hash1? and hash1 == hash2
@isSameImage: (image1, image2) ->