mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-23 15:32:24 +00:00
compose: Fix network option field names and update dockerode types
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
fd68ee6a1c
commit
5c04df2cb8
9
package-lock.json
generated
9
package-lock.json
generated
@ -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": "*"
|
||||
}
|
||||
},
|
||||
|
@ -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",
|
||||
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
@ -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' ]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user