mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 00:45:23 +00:00
Auto-merge for PR #589 via VersionBot
Avoid trying to clean up the supervisor image if it has several tags …
This commit is contained in:
commit
a85692ca16
@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
|
||||
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## v7.1.14 - 2018-03-15
|
||||
|
||||
* Avoid trying to clean up the supervisor image if it has several tags (even though it would never succeed) #589 [Pablo Carranza Velez]
|
||||
|
||||
## v7.1.13 - 2018-03-15
|
||||
|
||||
* Fix typo passing apiKey to the resin API client when exchanging apikeys #588 [Pablo Carranza Velez]
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "resin-supervisor",
|
||||
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
|
||||
"version": "7.1.13",
|
||||
"version": "7.1.14",
|
||||
"license": "Apache-2.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -228,9 +228,10 @@ module.exports = class Images extends EventEmitter
|
||||
images = []
|
||||
Promise.join(
|
||||
@docker.getRegistryAndName(constants.supervisorImage)
|
||||
@docker.getImage(constants.supervisorImage).inspect()
|
||||
@db.models('image').select('dockerImageId')
|
||||
.map((image) -> image.dockerImageId)
|
||||
(supervisorImageInfo, usedImageIds) =>
|
||||
(supervisorImageInfo, supervisorImage, usedImageIds) =>
|
||||
isDangling = (image) ->
|
||||
# Looks like dangling images show up with these weird RepoTags and RepoDigests sometimes
|
||||
(_.isEmpty(image.RepoTags) or _.isEqual(image.RepoTags, [ '<none>:<none>' ])) and
|
||||
@ -240,7 +241,7 @@ module.exports = class Images extends EventEmitter
|
||||
# Cleanup should remove truly dangling images (i.e. dangling and with no digests)
|
||||
if isDangling(image) and not (image.Id in usedImageIds)
|
||||
images.push(image.Id)
|
||||
else if !_.isEmpty(image.RepoTags)
|
||||
else if !_.isEmpty(image.RepoTags) and image.Id != supervisorImage.Id
|
||||
# We also remove images from the supervisor repository with a different tag
|
||||
Promise.map image.RepoTags, (repoTag) =>
|
||||
@docker.getRegistryAndName(repoTag)
|
||||
|
Loading…
x
Reference in New Issue
Block a user