Loop over container networks

This commit is contained in:
Tony Garnock-Jones 2019-06-13 16:08:47 +01:00
parent 69393e3f0f
commit 6f8fd0300a
1 changed files with 3 additions and 5 deletions

View File

@ -95,10 +95,10 @@ spawn named 'docker-scan' {
react {
stop on message DockerContainers(_);
containers.forEach((info) => {
const net = info.NetworkSettings.Networks.bridge;
if (net) {
for (let netname in info.NetworkSettings.Networks) {
const net = info.NetworkSettings.Networks[netname];
info.Names.forEach((n) => {
const name = n.replace('/', '');
const name = n.replace('/', '') + '.' + netname;
assert DockerContainerInfo(name, info);
info.Ports.forEach((p) => {
if (p.Type === 'tcp') {
@ -106,8 +106,6 @@ spawn named 'docker-scan' {
}
});
});
} else {
debug('No bridge network for container', info.Id, info.Names);
}
});
}