diff options
-rw-r--r-- | src/docker.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/docker.go b/src/docker.go index 3a052cb..6bf39ee 100644 --- a/src/docker.go +++ b/src/docker.go @@ -54,7 +54,9 @@ func listDockerContainers() { panic(err) } - // find the container names of the companion containers + // find the container names of the companion containers by iterating over + // all containers adding the containers containing the string "companion" in + // their names to the list of companion containers var companionContainerNames []string for _, container := range containers { @@ -65,7 +67,9 @@ func listDockerContainers() { fmt.Printf("%#v\n\n", companionContainerNames) - // find the IPs of the companion containers + // find the IPs of the companion containers by iterating over all networks, + // then iterating over all containers in the network and then testing if the + // container is part of the previously generated companion-containers-list. var companionContainerIPs []string for _, network := range networks { @@ -88,7 +92,7 @@ func listDockerContainers() { // strip the "/16" or so suffix (this might break, see the todo // below...) - // TODO: strip everything after the slash + // TODO: strip everything after the slash and the slash ip := rawip[:len(rawip)-3] fmt.Printf("ip: %s\n\n", ip) |