From b88e0e41d59c26dd281b41bdd0c754f54e90e3e2 Mon Sep 17 00:00:00 2001 From: Emile Date: Sun, 6 Oct 2019 23:52:58 +0200 Subject: added more detailed comments --- src/docker.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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) -- cgit 1.4.1