mirror of https://github.com/k3s-io/k3s
The Mac is picky about the syntax for listening on ephemeral ports.
parent
2324dc1510
commit
239e1273cf
|
@ -102,7 +102,7 @@ func (proxier Proxier) AddService(service string, port int) error {
|
|||
// For testing on a system with unknown ports used.
|
||||
func (proxier Proxier) addServiceOnUnusedPort(service string) (string, error) {
|
||||
// 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 {
|
||||
return "", err
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ func echoServer(t *testing.T, addr string) (string, error) {
|
|||
}
|
||||
|
||||
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 {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue