From 10350c3d4a10d3790157c9e0b9b3786ae7061a10 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Wed, 25 Nov 2015 15:00:45 -0800 Subject: [PATCH] Remove volumes when removing a container --- CHANGELOG.md | 1 + src/application.coffee | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3fee2a5..fd133f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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] diff --git a/src/application.coffee b/src/application.coffee index f29065df..8f89d915 100644 --- a/src/application.coffee +++ b/src/application.coffee @@ -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