Remove volumes when removing a container

This commit is contained in:
Pablo Carranza Velez 2015-11-25 15:00:45 -08:00
parent e03858d483
commit 10350c3d4a
2 changed files with 3 additions and 2 deletions

View File

@ -1,3 +1,4 @@
* Remove volumes when removing a container [Pablo]
* Refactor the still undocumented special env vars into RESIN_SUPERVISOR_ [Pablo]
* Implement several update strategies (kill before download, 0-downtime) [Pablo]
* Fix the error that comes up when no ip addresses are returned by gosuper [Praneeth]

View File

@ -97,7 +97,7 @@ application.kill = kill = (app, updateDB = true) ->
.then ->
container.stopAsync(t: 10)
.then ->
container.removeAsync()
container.removeAsync(v: true)
# Bluebird throws OperationalError for errors resulting in the normal execution of a promisified function.
.catch Promise.OperationalError, (err) ->
# Get the statusCode from the original cause and make sure statusCode its definitely a string for comparison
@ -105,7 +105,7 @@ application.kill = kill = (app, updateDB = true) ->
statusCode = '' + err.statusCode
# 304 means the container was already stopped - so we can just remove it
if statusCode is '304'
return container.removeAsync()
return container.removeAsync(v: true)
# 404 means the container doesn't exist, precisely what we want! :D
if statusCode is '404'
return