Fixes to service configuration

restart service does not rebuild automatically, we should add a route
for that. we need to figure where to scale services etc if we randomly
create containers like that.
This commit is contained in:
Girish Ramakrishnan
2021-01-21 12:53:38 -08:00
parent 47a598a494
commit 9f9575f46a
11 changed files with 200 additions and 190 deletions

View File

@@ -6,7 +6,8 @@ exports = module.exports = {
configure,
getLogs,
getLogStream,
restart
restart,
rebuild
};
const assert = require('assert'),
@@ -126,3 +127,13 @@ function restart(req, res, next) {
next(new HttpSuccess(202, {}));
});
}
function rebuild(req, res, next) {
assert.strictEqual(typeof req.params.service, 'string');
services.rebuildService(req.params.service, function (error) {
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(202, {}));
});
}