Do not allow duplicate mounts

This commit is contained in:
Girish Ramakrishnan
2020-10-29 22:08:31 -07:00
parent 65eae30a48
commit cd3dc00f2f
3 changed files with 4 additions and 1 deletions

View File

@@ -995,6 +995,7 @@ function setMounts(app, mounts, auditSource, callback) {
values: { mounts }
};
addTask(appId, exports.ISTATE_PENDING_RECREATE_CONTAINER, task, function (error, result) {
if (error && error.reason === BoxError.ALREADY_EXISTS) return callback(new BoxError(BoxError.CONFLICT, 'Duplicate mount points'));
if (error) return callback(error);
eventlog.add(eventlog.ACTION_APP_CONFIGURE, auditSource, { appId, app, mounts, taskId: result.taskId });