rename setupStorage to setupManagedStorage

This commit is contained in:
Girish Ramakrishnan
2024-06-25 12:38:27 +02:00
parent 36a768eb60
commit d9b478cf1f
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -2275,7 +2275,7 @@ async function importApp(app, data, auditSource) {
backupConfig.encryption = null;
}
await backups.setupStorage(backupConfig, `/mnt/appimport-${app.id}`); // this validates mountOptions . this is not cleaned up, it's fine
await backups.setupManagedStorage(backupConfig, `/mnt/appimport-${app.id}`); // this validates mountOptions . this is not cleaned up, it's fine
backupConfig.rootPath = backups.getRootPath(backupConfig, `/mnt/appimport-${app.id}`);
error = await backups.testStorage(Object.assign({ mountPath: `/mnt/appimport-${app.id}` }, backupConfig)); // this validates provider and it's api options. requires mountPath
if (error) throw error;
+1 -1
View File
@@ -352,7 +352,7 @@ async function install(app, args, progressCallback) {
await services.setupAddons(app, app.manifest.addons);
await services.clearAddons(app, app.manifest.addons);
const backupConfig = restoreConfig.backupConfig;
const mountObject = await backups.setupStorage(backupConfig, `/mnt/appimport-${app.id}`);
const mountObject = await backups.setupManagedStorage(backupConfig, `/mnt/appimport-${app.id}`);
if (mountObject) await progressCallback({ percent: 70, message: 'Setting up mount for importing' });
backupConfig.rootPath = backups.getRootPath(backupConfig, `/mnt/appimport-${app.id}`);
await backuptask.downloadApp(app, restoreConfig, (progress) => { progressCallback({ percent: 75, message: progress.message }); });
+5 -5
View File
@@ -35,7 +35,7 @@ exports = module.exports = {
setLimits,
getRootPath,
setupStorage,
setupManagedStorage,
remount,
getMountStatus,
@@ -448,7 +448,7 @@ function validateFormat(format) {
return new BoxError(BoxError.BAD_FIELD, 'Invalid backup format');
}
async function setupStorage(storageConfig, hostPath) {
async function setupManagedStorage(storageConfig, hostPath) {
assert.strictEqual(typeof storageConfig, 'object');
assert.strictEqual(typeof hostPath, 'string');
@@ -459,7 +459,7 @@ async function setupStorage(storageConfig, hostPath) {
const error = mounts.validateMountOptions(storageConfig.provider, storageConfig.mountOptions);
if (error) throw error;
debug(`setupStorage: setting up mount at ${hostPath} with ${storageConfig.provider}`);
debug(`setupManagedStorage: setting up mount at ${hostPath} with ${storageConfig.provider}`);
const newMount = {
name: path.basename(hostPath),
@@ -499,7 +499,7 @@ async function setStorage(storageConfig) {
}
debug('setStorage: validating new storage configuration');
const testMountObject = await setupStorage(storageConfig, '/mnt/backup-storage-validation'); // this validates mountOptions
const testMountObject = await setupManagedStorage(storageConfig, '/mnt/backup-storage-validation'); // this validates mountOptions
const testStorageError = await testStorage(Object.assign({ mountPath: '/mnt/backup-storage-validation' }, storageConfig)); // this validates provider and it's api options. requires mountPath
if (testMountObject) await mounts.removeMount(testMountObject);
if (testStorageError) throw testStorageError;
@@ -508,7 +508,7 @@ async function setStorage(storageConfig) {
if (mounts.isManagedProvider(oldConfig.provider)) await safe(mounts.removeMount(managedBackupMountObject(oldConfig)));
debug('setStorage: setting up new storage configuration');
await setupStorage(storageConfig, paths.MANAGED_BACKUP_MOUNT_DIR);
await setupManagedStorage(storageConfig, paths.MANAGED_BACKUP_MOUNT_DIR);
debug('setStorage: clearing backup cache');
cleanupCacheFilesSync();
+1 -1
View File
@@ -236,7 +236,7 @@ async function restore(backupConfig, remotePath, version, ipv4Config, ipv6Config
backupConfig.encryption = null;
}
await backups.setupStorage(backupConfig, paths.MANAGED_BACKUP_MOUNT_DIR); // this validates mountOptions
await backups.setupManagedStorage(backupConfig, paths.MANAGED_BACKUP_MOUNT_DIR); // this validates mountOptions
error = await backups.testStorage(Object.assign({ mountPath: paths.MANAGED_BACKUP_MOUNT_DIR }, backupConfig)); // this validates provider and it's api options. requires mountPath
if (error) throw error;