Merge pull request #964 from balena-io/fix-double-expose

compose: Remove unique expose entries after adding all entries
This commit is contained in:
CameronDiver 2019-04-11 11:05:32 +01:00 committed by GitHub
commit 7be1fa3c08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -279,12 +279,12 @@ export class Service {
{}, {},
); );
expose = expose.concat(_.keys(imageExposedPorts)); expose = expose.concat(_.keys(imageExposedPorts));
expose = _.uniq(expose);
// Also add any exposed ports which are implied from the portMaps // Also add any exposed ports which are implied from the portMaps
const exposedFromPortMappings = _.flatMap(portMaps, port => const exposedFromPortMappings = _.flatMap(portMaps, port =>
port.toExposedPortArray(), port.toExposedPortArray(),
); );
expose = expose.concat(exposedFromPortMappings); expose = expose.concat(exposedFromPortMappings);
expose = _.uniq(expose);
delete config.expose; delete config.expose;
let devices: DockerDevice[] = []; let devices: DockerDevice[] = [];