findSimilarImage should always return an array, and test the repoTag[0]

This commit is contained in:
Pablo Carranza Vélez 2015-11-11 01:23:39 -03:00 committed by Pablo Carranza Velez
parent 8e4e844cfa
commit 1a5a9b0e23

View File

@ -39,10 +39,10 @@ findSimilarImage = (repoTag) ->
return repoTag
# Otherwise return the most specific supervisor tag (commit hash)
for repoTag in repoTags when /resin\/.*-supervisor.*:[0-9a-f]{6}/.test(repoTag)
for repoTag in repoTags when /resin\/.*-supervisor.*:[0-9a-f]{6}/.test(repoTag[0])
return repoTag
return config.supervisorImage
return [ config.supervisorImage ]
exports.rsyncImageWithProgress = (imgDest, onProgress) ->
findSimilarImage(imgDest)