restore: mount all volumes before restoring apps

fixes #786
This commit is contained in:
Girish Ramakrishnan
2021-09-28 11:51:01 -07:00
parent d79206f978
commit 3bcd32c56d
3 changed files with 17 additions and 6 deletions
+3 -4
View File
@@ -20,6 +20,7 @@ const apps = require('./apps.js'),
services = require('./services.js'),
shell = require('./shell.js'),
tasks = require('./tasks.js'),
volumes = require('./volumes.js'),
_ = require('underscore');
async function start(options) {
@@ -47,10 +48,8 @@ async function start(options) {
const error = locker.lock(locker.OP_PLATFORM_START);
if (error) throw error;
if (existingInfra.version !== infra.version) {
await removeAllContainers();
}
if (existingInfra.version !== infra.version) await removeAllContainers();
if (existingInfra.version === 'none') await volumes.mountAll(); // when restoring, mount all volumes
await markApps(existingInfra, options); // mark app state before we start addons. this gives the db import logic a chance to mark an app as errored
await services.startServices(existingInfra);
await fs.promises.writeFile(paths.INFRA_VERSION_FILE, JSON.stringify(infra, null, 4));