-
-
Couldn't load subscription status.
- Fork 258
Open
Labels
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
Ory Network Project
No response
Describe the bug
Using a PortBindings for an outbound ip causes an empty mapped port to be returned
Reproducing the bug
func TestOutboundIPPortBinding(t *testing.T) {
outboundIP := func() string {
conn, err := net.Dial("udp", "8.8.8.8:80")
require.NoError(t, err)
defer conn.Close()
localAddr := conn.LocalAddr().(*net.UDPAddr)
return localAddr.IP.String()
}()
resource, err := pool.RunWithOptions(
&dockertest.RunOptions{
Repository: "postgres",
Tag: "9.5",
Env: []string{"POSTGRES_PASSWORD=secret"},
PortBindings: map[dc.Port][]dc.PortBinding{
"5432/tcp": {{HostIP: outboundIP, HostPort: "0"}},
},
})
require.NoError(t, err)
mappedPort := resource.GetPort("5432/tcp")
require.NotEmpty(t, mappedPort)
boundIP := resource.GetBoundIP("5432/tcp")
require.Equal(t, outboundIP, boundIP)
require.NoError(t, pool.Purge(resource))
}Relevant log output
No response
Relevant configuration
No response
Version
latest dockertest
On which operating system are you observing this issue?
macOS
In which environment are you deploying?
None
Additional Context
No response