Create correct mount objects for mountpoint validation

This commit is contained in:
Johannes Zellner
2025-08-04 15:25:27 +02:00
parent cf86645bb5
commit a887be432b

View File

@@ -333,7 +333,14 @@ async function verifyConfig({ id, provider, config }) {
const error = mounts.validateMountOptions(provider, config.mountOptions);
if (error) throw error;
await mounts.tryAddMount(mountObjectFromConfig({ _provider: provider, mountOptions: config.mountOptions, hostPath: `${managedMountPath}-validation` }), { timeout: 10 });
const tmpConfig = {
description: `Cloudron Validation Mount`,
hostPath: `${managedMountPath}-validation`,
mountType: provider,
mountOptions: config.mountOptions
};
await mounts.tryAddMount(tmpConfig, { timeout: 10 });
} else if (provider === mounts.MOUNT_TYPE_MOUNTPOINT) {
if (!config.mountPoint || typeof config.mountPoint !== 'string') throw new BoxError(BoxError.BAD_FIELD, 'mountPoint must be non-empty string');
const error = validateDestDir(config.mountPoint);