mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #104 from jbeda/proxy-test-fix
The Mac is picky about the syntax for listening on ephemeral ports.
This commit is contained in:
commit
a40529b379
@ -102,7 +102,7 @@ func (proxier Proxier) AddService(service string, port int) error {
|
|||||||
// For testing on a system with unknown ports used.
|
// For testing on a system with unknown ports used.
|
||||||
func (proxier Proxier) addServiceOnUnusedPort(service string) (string, error) {
|
func (proxier Proxier) addServiceOnUnusedPort(service string) (string, error) {
|
||||||
// Make sure we can start listening on the port before saying all's well.
|
// Make sure we can start listening on the port before saying all's well.
|
||||||
l, err := net.Listen("tcp", ":")
|
l, err := net.Listen("tcp", ":0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ func echoServer(t *testing.T, addr string) (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestProxy(t *testing.T) {
|
func TestProxy(t *testing.T) {
|
||||||
port, err := echoServer(t, "127.0.0.1:")
|
port, err := echoServer(t, "127.0.0.1:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user