Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
a40529b3
Commit
a40529b3
authored
Jun 13, 2014
by
Daniel Smith
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #104 from jbeda/proxy-test-fix
The Mac is picky about the syntax for listening on ephemeral ports.
parents
2324dc15
239e1273
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
proxier.go
pkg/proxy/proxier.go
+1
-1
proxier_test.go
pkg/proxy/proxier_test.go
+1
-1
No files found.
pkg/proxy/proxier.go
View file @
a40529b3
...
@@ -102,7 +102,7 @@ func (proxier Proxier) AddService(service string, port int) error {
...
@@ -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
}
}
...
...
pkg/proxy/proxier_test.go
View file @
a40529b3
...
@@ -46,7 +46,7 @@ func echoServer(t *testing.T, addr string) (string, error) {
...
@@ -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
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment