replace usage of _.extend with Object.assign
This commit is contained in:
@@ -46,8 +46,7 @@ const apps = require('./apps.js'),
|
||||
safe = require('safetydance'),
|
||||
system = require('./system.js'),
|
||||
timers = require('timers/promises'),
|
||||
volumes = require('./volumes.js'),
|
||||
_ = require('underscore');
|
||||
volumes = require('./volumes.js');
|
||||
|
||||
const DOCKER_SOCKET_PATH = '/var/run/docker.sock';
|
||||
const gConnection = new Docker({ socketPath: DOCKER_SOCKET_PATH });
|
||||
@@ -318,7 +317,7 @@ async function createSubcontainer(app, name, cmd, options) {
|
||||
app.manifest.runtimeDirs.forEach(dir => runtimeVolumes[dir] = {});
|
||||
}
|
||||
|
||||
let containerOptions = {
|
||||
const containerOptions = {
|
||||
name: name, // for referencing containers
|
||||
Tty: isAppContainer,
|
||||
Image: app.manifest.dockerImage,
|
||||
@@ -405,9 +404,9 @@ async function createSubcontainer(app, name, cmd, options) {
|
||||
];
|
||||
}
|
||||
|
||||
containerOptions = _.extend(containerOptions, options);
|
||||
const mergedOptions = Object.assign({}, containerOptions, options);
|
||||
|
||||
const [createError, container] = await safe(gConnection.createContainer(containerOptions));
|
||||
const [createError, container] = await safe(gConnection.createContainer(mergedOptions));
|
||||
if (createError && createError.statusCode === 409) throw new BoxError(BoxError.ALREADY_EXISTS, createError);
|
||||
if (createError) throw new BoxError(BoxError.DOCKER_ERROR, createError);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user