about summary refs log tree commit diff
path: root/src/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/container.go')
-rw-r--r--src/container.go10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/container.go b/src/container.go
index 29046e2..c06a9ed 100644
--- a/src/container.go
+++ b/src/container.go
@@ -8,10 +8,6 @@ import (
 	"time"
 )
 
-const (
-	containerNetworkName = "circus-vpnnet"
-)
-
 type ChallengeContainer struct {
 	Challenge *Challenge
 	ContainerID string
@@ -26,7 +22,7 @@ func (cc ChallengeContainer) startContainer() (address string, containerID strin
 
 	// Set up container network
 	if containerNetworkID == "" {
-		id, err := setupNetwork(containerNetworkName, true)
+		id, err := setupNetwork(getChallengeNetworkName(), true)
 		if (err != nil) {
 			return "", "", err
 		}
@@ -40,7 +36,7 @@ func (cc ChallengeContainer) startContainer() (address string, containerID strin
 		Tty: false,
 	}, nil, &network.NetworkingConfig{
 		EndpointsConfig: map[string]*network.EndpointSettings{
-			containerNetworkName: {
+			getChallengeNetworkName(): {
 				NetworkID: containerNetworkID,
 			},
 		},
@@ -63,7 +59,7 @@ func (cc ChallengeContainer) startContainer() (address string, containerID strin
 	}
 
 	// Return IP, Container ID and error
-	return inspectJSON.NetworkSettings.Networks[containerNetworkName].IPAddress, resp.ID,nil
+	return inspectJSON.NetworkSettings.Networks[getChallengeNetworkName()].IPAddress, resp.ID,nil
 }
 
 // Stops the container with a timeout of one second