Update redis addon container

Fixes #223
This commit is contained in:
Girish Ramakrishnan
2018-10-16 15:40:40 -07:00
parent 045cfeeb0d
commit 858f03e02d
2 changed files with 9 additions and 2 deletions
+9
View File
@@ -348,6 +348,7 @@ function startAddons(existingInfra, callback) {
startMysql.bind(null, existingInfra),
startPostgresql.bind(null, existingInfra),
startMongodb.bind(null, existingInfra),
startRedis.bind(null, existingInfra),
mail.startMail);
} else {
assert.strictEqual(typeof existingInfra.images, 'object');
@@ -356,6 +357,7 @@ function startAddons(existingInfra, callback) {
if (infra.images.postgresql.tag !== existingInfra.images.postgresql.tag) startFuncs.push(startPostgresql.bind(null, existingInfra));
if (infra.images.mongodb.tag !== existingInfra.images.mongodb.tag) startFuncs.push(startMongodb.bind(null, existingInfra));
if (infra.images.mail.tag !== existingInfra.images.mail.tag) startFuncs.push(mail.startMail);
if (infra.images.redis.tag !== existingInfra.images.redis.tag) startFuncs.push(startRedis.bind(null, existingInfra));
debug('startAddons: existing infra. incremental addon create %j', startFuncs.map(function (f) { return f.name; }));
}
@@ -1211,6 +1213,13 @@ function restoreMongoDb(app, options, callback) {
});
}
function startRedis(existingInfra, callback) {
assert.strictEqual(typeof existingInfra, 'object');
assert.strictEqual(typeof callback, 'function');
importDatabase('redis', callback); // setupRedis currently starts the app container
}
// Ensures that app's addon redis container is running. Can be called when named container already exists/running
function setupRedis(app, options, callback) {
assert.strictEqual(typeof app, 'object');
-2
View File
@@ -96,7 +96,6 @@ function removeOldImages(callback) {
debug('removing old addon images');
for (var imageName in infra.images) {
if (imageName === 'redis') continue; // see #223
const image = infra.images[imageName];
const tag = image.tag.replace(/:.*@/, '@'); // this remove the semver tag
debug('cleaning up images of %j', image);
@@ -118,7 +117,6 @@ function stopContainers(existingInfra, callback) {
assert(typeof infra.images, 'object');
var changedAddons = [ ];
for (var imageName in infra.images) {
if (imageName === 'redis') continue; // see #223
if (infra.images[imageName].tag !== existingInfra.images[imageName].tag) changedAddons.push(imageName);
}