From cbb1ab24a40b5e84adcd44a4d0d4d7fdd9f49f5f Mon Sep 17 00:00:00 2001 From: maride Date: Sun, 2 Sep 2018 01:49:26 +0200 Subject: Abort on errors --- src/container.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/container.go') diff --git a/src/container.go b/src/container.go index 5b2075b..c9a918f 100644 --- a/src/container.go +++ b/src/container.go @@ -1,15 +1,15 @@ package main import ( - "github.com/docker/docker/api/types/container" - "github.com/docker/docker/api/types" "fmt" - "time" + "github.com/docker/docker/api/types" + "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/network" + "time" ) const ( - VPNNetworkName = "vpn-network" + VPNNetworkName = "circus-vpnnet" ) type ChallengeContainer struct { @@ -24,7 +24,11 @@ func (cc ChallengeContainer) startContainer() (address string, containerID strin setupContext() setupDockerCLI() // Set up network - setupNetwork() + err = setupNetwork() + + if err != nil { + return "", "", err + } // Create container resp, err := dockerCli.ContainerCreate(dockerCtx, &container.Config{ -- cgit 1.4.1