volumes: set hostPath based on volume id
this is required for the file browser to work which does operations based on the id fixes #789
This commit is contained in:
@@ -31,10 +31,11 @@ async function add(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
|
||||
if (typeof req.body.name !== 'string') return next(new HttpError(400, 'name must be a string'));
|
||||
if (typeof req.body.hostPath !== 'string') return next(new HttpError(400, 'hostPath must be a string'));
|
||||
if (typeof req.body.mountType !== 'string') return next(new HttpError(400, 'mountType must be a string'));
|
||||
if (typeof req.body.mountOptions !== 'object') return next(new HttpError(400, 'mountOptions must be a object'));
|
||||
|
||||
if ('hostPath' in req.body && typeof req.body.hostPath !== 'string') return next(new HttpError(400, 'hostPath must be a string'));
|
||||
|
||||
req.clearTimeout(); // waiting for mount can take time
|
||||
|
||||
const [error, id] = await safe(volumes.add(req.body, auditSource.fromRequest(req)));
|
||||
|
||||
Reference in New Issue
Block a user