sftp.rebuild does not need options anymore

This commit is contained in:
Johannes Zellner
2020-08-19 19:08:12 +02:00
parent ec5129d25b
commit 4f9cb9a8a1
2 changed files with 3 additions and 11 deletions

View File

@@ -19,16 +19,13 @@ function startSftp(existingInfra, callback) {
if (existingInfra.version === infra.version && infra.images.sftp.tag === existingInfra.images.sftp.tag) return callback();
rebuild({}, callback);
rebuild(callback);
}
// options only supports ignoredApps = [ appId ]
function rebuild(options, callback) {
function rebuild(callback) {
assert.strictEqual(typeof options, 'object');
assert.strictEqual(typeof callback, 'function');
if (options.ignoredApps) assert(Array.isArray(options.ignoredApps), 'Expecting ignoredApps to be an array');
debug('rebuilding container');
const tag = infra.images.sftp.tag;
@@ -41,11 +38,6 @@ function rebuild(options, callback) {
result.forEach(function (app) {
if (!app.manifest.addons['localstorage']) return;
if (options.ignoredApps && options.ignoredApps.indexOf(app.id) !== -1) {
debug(`Ignoring volume for ${app.id}`);
return;
}
const hostDir = apps.getDataDir(app, app.dataDir), mountDir = `/app/data/${app.id}`;
if (!safe.fs.existsSync(hostDir)) {
// do not create host path when cloudron is restoring. this will then create dir with root perms making restore logic fail