We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 80e123f commit a1776e4Copy full SHA for a1776e4
e2e/helper_test.go
@@ -38,5 +38,6 @@ func (c *Container) Stop(t *testing.T) {
38
// GetAddress returns the host:port this container listens on
39
func (c *Container) GetAddress(t *testing.T) string {
40
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"))
+ port := strings.Split(strings.Split(result.Stdout(), ":")[1], "\n")[0]
42
+ return fmt.Sprintf("127.0.0.1:%v", strings.Trim(port, " \r\n"))
43
}
0 commit comments