Add some debugs for volume rewriting

This commit is contained in:
Johannes Zellner
2018-08-15 16:51:10 +02:00
parent 4a739213bf
commit 12970bf50a

View File

@@ -68,6 +68,7 @@ function containersCreate(req, res, next) {
safe.set(req.body, 'HostConfig.NetworkMode', 'cloudron'); // overwrite the network the container lives in
safe.set(req.body, 'Labels', _.extend({ }, safe.query(req.body, 'Labels'), { appId: req.app.id })); // overwrite the app id to track containers of an app
debug('Original volume binds:', req.body.HostConfig.Binds);
let binds = [];
for (let bind of (req.body.HostConfig.Binds || [])) {
if (!bind.startsWith('/app/data')) {
@@ -77,6 +78,7 @@ function containersCreate(req, res, next) {
binds.push(bind.replace(new RegExp('^/app/data'), path.join(paths.APPS_DATA_DIR, req.app.id, 'data')));
}
safe.set(req.body, 'HostConfig.Binds', binds);
debug('Rewritten volume binds:', req.body.HostConfig.Binds);
let plainBody = JSON.stringify(req.body);