Skip to content

Commit

Permalink
Changed how we get the docker port
Browse files Browse the repository at this point in the history
Signed-off-by: David Gannon <[email protected]>
  • Loading branch information
dgannon991 committed Jan 13, 2025
1 parent 80e123f commit a1776e4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion e2e/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}

0 comments on commit a1776e4

Please sign in to comment.