diff --git a/package-lock.json b/package-lock.json index f072fd78..65998e40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "balena-supervisor", - "version": "8.4.3", + "version": "8.6.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -63,12 +63,11 @@ "dev": true }, "@types/dockerode": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-2.5.5.tgz", - "integrity": "sha512-NSDdW9JUia7bLba87jTfZR/o1YcIFDcSC9HcdrXGJluHVfl8hXiUBFJwB9z3LSk/xmvv/pmEKzHFq6JmpNhlfg==", + "version": "2.5.9", + "resolved": "https://registry.npmjs.org/@types/dockerode/-/dockerode-2.5.9.tgz", + "integrity": "sha512-JS7NIXYcXitpNT3I5rYw68C3VhYmO2AHUbxr5uYsKDyL7SURlhdYGmseg0fCmBQLCl/VoK32NsJLYSR7mifBVA==", "dev": true, "requires": { - "@types/events": "*", "@types/node": "*" } }, diff --git a/package.json b/package.json index 78251804..f4c75fc4 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "devDependencies": { "@types/bluebird": "^3.5.20", - "@types/dockerode": "2.5.5", + "@types/dockerode": "^2.5.9", "@types/event-stream": "^3.3.34", "@types/express": "^4.11.1", "@types/knex": "^0.14.14", diff --git a/src/compose/utils.ts b/src/compose/utils.ts index 9ba0a481..7fce3041 100644 --- a/src/compose/utils.ts +++ b/src/compose/utils.ts @@ -417,18 +417,20 @@ export function serviceNetworksToDockerNetworks( conf.IPAMConfig = {}; conf.Aliases = []; _.each(net, (v, k) => { + // We know that IPAMConfig is set because of the intialisation + // above, but typescript doesn't agree, so use ! switch (k) { case 'ipv4Address': - conf.IPAMConfig.IPV4Address = v; + conf.IPAMConfig!.IPv4Address = v as string; break; case 'ipv6Address': - conf.IPAMConfig.IPV6Address = v; + conf.IPAMConfig!.IPv6Address = v as string; break; case 'linkLocalIps': - conf.IPAMConfig.LinkLocalIps = v; + conf.IPAMConfig!.LinkLocalIPs = v as string[]; break; case 'aliases': - conf.Aliases = v; + conf.Aliases = v as string[]; break; } }); diff --git a/test/04-service.spec.coffee b/test/04-service.spec.coffee index 453c30b8..98b40190 100644 --- a/test/04-service.spec.coffee +++ b/test/04-service.spec.coffee @@ -309,7 +309,7 @@ describe 'compose/service', -> EndpointsConfig: { '123456_balena': { IPAMConfig: { - IPV4Address: '1.2.3.4' + IPv4Address: '1.2.3.4' }, Aliases: [] } @@ -327,9 +327,9 @@ describe 'compose/service', -> EndpointsConfig: { '123456_balena': { IPAMConfig: { - IPV4Address: '1.2.3.4' - IPV6Address: '5.6.7.8' - LinkLocalIps: [ '123.123.123' ] + IPv4Address: '1.2.3.4' + IPv6Address: '5.6.7.8' + LinkLocalIPs: [ '123.123.123' ] } Aliases: [ 'test', '1123' ] }