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
269ad321
Commit
269ad321
authored
Mar 13, 2015
by
Subin M
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix proxy_test.go file to avoid ChooseHostInterface
parent
4420e045
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
10 deletions
+14
-10
proxier.go
pkg/proxy/proxier.go
+4
-0
proxier_test.go
pkg/proxy/proxier_test.go
+10
-10
No files found.
pkg/proxy/proxier.go
View file @
269ad321
...
@@ -325,6 +325,10 @@ func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.In
...
@@ -325,6 +325,10 @@ func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, iptables iptables.In
return
nil
return
nil
}
}
glog
.
Infof
(
"Setting Proxy IP to %v"
,
hostIP
)
glog
.
Infof
(
"Setting Proxy IP to %v"
,
hostIP
)
return
CreateProxier
(
loadBalancer
,
listenIP
,
iptables
,
hostIP
)
}
func
CreateProxier
(
loadBalancer
LoadBalancer
,
listenIP
net
.
IP
,
iptables
iptables
.
Interface
,
hostIP
net
.
IP
)
*
Proxier
{
glog
.
Infof
(
"Initializing iptables"
)
glog
.
Infof
(
"Initializing iptables"
)
// Clean up old messes. Ignore erors.
// Clean up old messes. Ignore erors.
iptablesDeleteOld
(
iptables
)
iptablesDeleteOld
(
iptables
)
...
...
pkg/proxy/proxier_test.go
View file @
269ad321
...
@@ -201,7 +201,7 @@ func TestTCPProxy(t *testing.T) {
...
@@ -201,7 +201,7 @@ func TestTCPProxy(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
...
@@ -221,7 +221,7 @@ func TestUDPProxy(t *testing.T) {
...
@@ -221,7 +221,7 @@ func TestUDPProxy(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
...
@@ -250,7 +250,7 @@ func TestTCPProxyStop(t *testing.T) {
...
@@ -250,7 +250,7 @@ func TestTCPProxyStop(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
...
@@ -281,7 +281,7 @@ func TestUDPProxyStop(t *testing.T) {
...
@@ -281,7 +281,7 @@ func TestUDPProxyStop(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
...
@@ -312,7 +312,7 @@ func TestTCPProxyUpdateDelete(t *testing.T) {
...
@@ -312,7 +312,7 @@ func TestTCPProxyUpdateDelete(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
...
@@ -342,7 +342,7 @@ func TestUDPProxyUpdateDelete(t *testing.T) {
...
@@ -342,7 +342,7 @@ func TestUDPProxyUpdateDelete(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
...
@@ -372,7 +372,7 @@ func TestTCPProxyUpdateDeleteUpdate(t *testing.T) {
...
@@ -372,7 +372,7 @@ func TestTCPProxyUpdateDeleteUpdate(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
...
@@ -411,7 +411,7 @@ func TestUDPProxyUpdateDeleteUpdate(t *testing.T) {
...
@@ -411,7 +411,7 @@ func TestUDPProxyUpdateDeleteUpdate(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
...
@@ -450,7 +450,7 @@ func TestTCPProxyUpdatePort(t *testing.T) {
...
@@ -450,7 +450,7 @@ func TestTCPProxyUpdatePort(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"TCP"
,
0
,
time
.
Second
)
...
@@ -486,7 +486,7 @@ func TestUDPProxyUpdatePort(t *testing.T) {
...
@@ -486,7 +486,7 @@ func TestUDPProxyUpdatePort(t *testing.T) {
},
},
})
})
p
:=
NewProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{}
)
p
:=
CreateProxier
(
lb
,
net
.
ParseIP
(
"0.0.0.0"
),
&
fakeIptables
{},
net
.
ParseIP
(
"127.0.0.1"
)
)
waitForNumProxyLoops
(
t
,
p
,
0
)
waitForNumProxyLoops
(
t
,
p
,
0
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
svcInfo
,
err
:=
p
.
addServiceOnPort
(
"echo"
,
"UDP"
,
0
,
time
.
Second
)
...
...
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