mounts: rename name to description
this makes it clear that the field is not important
This commit is contained in:
@@ -241,7 +241,7 @@ async function setupManagedMount(apiConfig, hostPath) {
|
||||
debug(`setupManagedMount: setting up mount at ${hostPath} with ${apiConfig.provider}`);
|
||||
|
||||
const newMount = {
|
||||
name: path.basename(hostPath),
|
||||
description: `Cloudron Managed Mount`,
|
||||
hostPath,
|
||||
mountType: apiConfig.provider,
|
||||
mountOptions: apiConfig.mountOptions
|
||||
@@ -257,14 +257,8 @@ async function setup(apiConfig) {
|
||||
|
||||
debug('setup: removing old storage configuration');
|
||||
if (!mounts.isManagedProvider(apiConfig.provider)) return;
|
||||
const oldMountObject = {
|
||||
name: 'backup',
|
||||
hostPath: paths.MANAGED_BACKUP_MOUNT_DIR,
|
||||
mountType: apiConfig.provider,
|
||||
mountOptions: apiConfig.mountOptions // must have already been validated
|
||||
};
|
||||
|
||||
await safe(mounts.removeMount(oldMountObject), { debug }); // ignore error
|
||||
await safe(mounts.removeMount(paths.MANAGED_BACKUP_MOUNT_DIR), { debug }); // ignore error
|
||||
|
||||
debug('setup: setting up new storage configuration');
|
||||
await setupManagedMount(apiConfig, paths.MANAGED_BACKUP_MOUNT_DIR);
|
||||
@@ -274,14 +268,8 @@ async function teardown(apiConfig) {
|
||||
assert.strictEqual(typeof apiConfig, 'object');
|
||||
|
||||
if (!mounts.isManagedProvider(apiConfig.provider)) return;
|
||||
const mountObject = {
|
||||
name: 'backup',
|
||||
hostPath: paths.MANAGED_BACKUP_MOUNT_DIR,
|
||||
mountType: apiConfig.provider,
|
||||
mountOptions: apiConfig.mountOptions
|
||||
};
|
||||
|
||||
await safe(mounts.removeMount(mountObject), { debug }); // ignore error
|
||||
await safe(mounts.removeMount(paths.MANAGED_BACKUP_MOUNT_DIR), { debug }); // ignore error
|
||||
}
|
||||
|
||||
async function testConfig(apiConfig) {
|
||||
@@ -333,7 +321,7 @@ async function testConfig(apiConfig) {
|
||||
throw new BoxError(BoxError.BAD_FIELD, `Unable to remove test file as 'yellowtent' user in ${rootPath}: ${safe.error.message}. Check dir/mount permissions`);
|
||||
}
|
||||
|
||||
if (testMountObject) await mounts.removeMount(testMountObject);
|
||||
if (testMountObject) await mounts.removeMount('/mnt/backup-storage-validation');
|
||||
}
|
||||
|
||||
function removePrivateFields(apiConfig) {
|
||||
|
||||
Reference in New Issue
Block a user