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
d56344fd
Commit
d56344fd
authored
Jul 30, 2017
by
m1093782566
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix winspace wrong comment message
parent
02b520f0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
12 deletions
+4
-12
proxier.go
pkg/proxy/winuserspace/proxier.go
+4
-12
No files found.
pkg/proxy/winuserspace/proxier.go
View file @
d56344fd
...
@@ -122,22 +122,14 @@ var (
...
@@ -122,22 +122,14 @@ var (
ErrProxyOnLocalhost
=
fmt
.
Errorf
(
"cannot proxy on localhost"
)
ErrProxyOnLocalhost
=
fmt
.
Errorf
(
"cannot proxy on localhost"
)
)
)
// IsProxyLocked returns true if the proxy could not acquire the lock on iptables.
func
IsProxyLocked
(
err
error
)
bool
{
return
strings
.
Contains
(
err
.
Error
(),
"holding the xtables lock"
)
}
// Used below.
// Used below.
var
localhostIPv4
=
net
.
ParseIP
(
"127.0.0.1"
)
var
localhostIPv4
=
net
.
ParseIP
(
"127.0.0.1"
)
var
localhostIPv6
=
net
.
ParseIP
(
"::1"
)
var
localhostIPv6
=
net
.
ParseIP
(
"::1"
)
// NewProxier returns a new Proxier given a LoadBalancer and an address on
// NewProxier returns a new Proxier given a LoadBalancer and an address on
// which to listen. Because of the iptables logic, It is assumed that there
// which to listen. It is assumed that there is only a single Proxier active
// is only a single Proxier active on a machine. An error will be returned if
// on a machine. An error will be returned if the proxier cannot be started
// the proxier cannot be started due to an invalid ListenIP (loopback) or
// due to an invalid ListenIP (loopback)
// if iptables fails to update or acquire the initial lock. Once a proxier is
// created, it will keep iptables up to date in the background and will not
// terminate if a particular iptables call fails.
func
NewProxier
(
loadBalancer
LoadBalancer
,
listenIP
net
.
IP
,
netsh
netsh
.
Interface
,
pr
utilnet
.
PortRange
,
syncPeriod
,
udpIdleTimeout
time
.
Duration
)
(
*
Proxier
,
error
)
{
func
NewProxier
(
loadBalancer
LoadBalancer
,
listenIP
net
.
IP
,
netsh
netsh
.
Interface
,
pr
utilnet
.
PortRange
,
syncPeriod
,
udpIdleTimeout
time
.
Duration
)
(
*
Proxier
,
error
)
{
if
listenIP
.
Equal
(
localhostIPv4
)
||
listenIP
.
Equal
(
localhostIPv6
)
{
if
listenIP
.
Equal
(
localhostIPv4
)
||
listenIP
.
Equal
(
localhostIPv6
)
{
return
nil
,
ErrProxyOnLocalhost
return
nil
,
ErrProxyOnLocalhost
...
@@ -148,7 +140,7 @@ func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, netsh netsh.Interfac
...
@@ -148,7 +140,7 @@ func NewProxier(loadBalancer LoadBalancer, listenIP net.IP, netsh netsh.Interfac
return
nil
,
fmt
.
Errorf
(
"failed to select a host interface: %v"
,
err
)
return
nil
,
fmt
.
Errorf
(
"failed to select a host interface: %v"
,
err
)
}
}
glog
.
V
(
2
)
.
Infof
(
"Setting proxy IP to %v
and initializing iptables
"
,
hostIP
)
glog
.
V
(
2
)
.
Infof
(
"Setting proxy IP to %v"
,
hostIP
)
return
createProxier
(
loadBalancer
,
listenIP
,
netsh
,
hostIP
,
syncPeriod
,
udpIdleTimeout
)
return
createProxier
(
loadBalancer
,
listenIP
,
netsh
,
hostIP
,
syncPeriod
,
udpIdleTimeout
)
}
}
...
...
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