Skip to content

Commit a1776e4

Browse files
committed
Changed how we get the docker port
Signed-off-by: David Gannon <19214156+dgannon991@users.noreply.github.com>
1 parent 80e123f commit a1776e4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

e2e/helper_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ func (c *Container) Stop(t *testing.T) {
3838
// GetAddress returns the host:port this container listens on
3939
func (c *Container) GetAddress(t *testing.T) string {
4040
result := icmd.RunCommand("docker", "port", c.container, strconv.Itoa(c.privatePort)).Assert(t, icmd.Success)
41-
return fmt.Sprintf("127.0.0.1:%v", strings.Trim(strings.Split(result.Stdout(), ":")[1], " \r\n"))
41+
port := strings.Split(strings.Split(result.Stdout(), ":")[1], "\n")[0]
42+
return fmt.Sprintf("127.0.0.1:%v", strings.Trim(port, " \r\n"))
4243
}

0 commit comments

Comments
 (0)