diff --git a/e2e/helper_test.go b/e2e/helper_test.go index 6a10c55..4b7cd7a 100644 --- a/e2e/helper_test.go +++ b/e2e/helper_test.go @@ -38,5 +38,6 @@ func (c *Container) Stop(t *testing.T) { // GetAddress returns the host:port this container listens on func (c *Container) GetAddress(t *testing.T) string { result := icmd.RunCommand("docker", "port", c.container, strconv.Itoa(c.privatePort)).Assert(t, icmd.Success) - return fmt.Sprintf("127.0.0.1:%v", strings.Trim(strings.Split(result.Stdout(), ":")[1], " \r\n")) + port := strings.Split(strings.Split(result.Stdout(), ":")[1], "\n")[0] + return fmt.Sprintf("127.0.0.1:%v", strings.Trim(port, " \r\n")) }