about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-06 23:52:58 +0200
committerEmile <hanemile@protonmail.com>2019-10-06 23:52:58 +0200
commitb88e0e41d59c26dd281b41bdd0c754f54e90e3e2 (patch)
tree52dc91f2ca7c44f9fcb8f13da8e2df417afc2cb8
parentc446baa342a54bf5caf5a1056a507dc52906cee0 (diff)
added more detailed comments
-rw-r--r--src/docker.go10
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)