diff --git a/src/apps.js b/src/apps.js index f6d116a5c..385aa97de 100644 --- a/src/apps.js +++ b/src/apps.js @@ -639,6 +639,8 @@ function update(appId, data, auditSource, callback) { newConfig.manifest = manifest; + // TODO: disallow portBindings when an app updates and let ports simply be disabled. the new ports + // might conflict when the update is actually carried out as we do not 'reserve' them in the db if ('portBindings' in data) { newConfig.portBindings = data.portBindings; error = validatePortBindings(data.portBindings, newConfig.manifest.tcpPorts); @@ -680,7 +682,6 @@ function update(appId, data, auditSource, callback) { appdb.setInstallationCommand(appId, data.force ? appdb.ISTATE_PENDING_FORCE_UPDATE : appdb.ISTATE_PENDING_UPDATE, { newConfig: newConfig }, function (error) { if (error && error.reason === DatabaseError.NOT_FOUND) return callback(new AppsError(AppsError.BAD_STATE)); // might be a bad guess - if (error && error.reason === DatabaseError.ALREADY_EXISTS) return callback(getDuplicateErrorDetails('' /* location cannot conflict */, values.portBindings, error)); if (error) return callback(new AppsError(AppsError.INTERNAL_ERROR, error)); taskmanager.restartAppTask(appId); diff --git a/src/routes/apps.js b/src/routes/apps.js index 73f5937b6..542eb506d 100644 --- a/src/routes/apps.js +++ b/src/routes/apps.js @@ -323,7 +323,6 @@ function updateApp(req, res, next) { if (error && error.reason === AppsError.NOT_FOUND) return next(new HttpError(404, 'No such app')); if (error && error.reason === AppsError.BAD_FIELD) return next(new HttpError(400, error.message)); if (error && error.reason === AppsError.BAD_STATE) return next(new HttpError(409, error.message)); - if (error && error.reason === AppsError.PORT_CONFLICT) return next(new HttpError(409, 'Port ' + error.message + ' is already in use.')); if (error) return next(new HttpError(500, error)); next(new HttpSuccess(202, { }));