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
83ada5c7
Commit
83ada5c7
authored
Nov 13, 2017
by
m1093782566
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace sets.List() with sets.UnsortedList()
parent
338ee7f5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
10 deletions
+10
-10
proxier.go
pkg/proxy/iptables/proxier.go
+1
-1
proxier_test.go
pkg/proxy/iptables/proxier_test.go
+3
-3
proxier.go
pkg/proxy/ipvs/proxier.go
+4
-4
proxier.go
pkg/proxy/userspace/proxier.go
+1
-1
proxier.go
pkg/proxy/winkernel/proxier.go
+1
-1
No files found.
pkg/proxy/iptables/proxier.go
View file @
83ada5c7
...
...
@@ -1609,7 +1609,7 @@ func (proxier *Proxier) syncProxyRules() {
// Finish housekeeping.
// TODO: these could be made more consistent.
for
_
,
svcIP
:=
range
staleServices
.
List
()
{
for
_
,
svcIP
:=
range
staleServices
.
Unsorted
List
()
{
if
err
:=
utilproxy
.
ClearUDPConntrackForIP
(
proxier
.
exec
,
svcIP
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to delete stale service IP %s connections, error: %v"
,
svcIP
,
err
)
}
...
...
pkg/proxy/iptables/proxier_test.go
View file @
83ada5c7
...
...
@@ -1050,7 +1050,7 @@ func TestBuildServiceMapAddRemove(t *testing.T) {
// the not-deleted service, because one of it's ServicePorts was deleted.
expectedStaleUDPServices
:=
[]
string
{
"172.16.55.10"
,
"172.16.55.4"
,
"172.16.55.11"
,
"172.16.55.12"
}
if
len
(
result
.
staleServices
)
!=
len
(
expectedStaleUDPServices
)
{
t
.
Errorf
(
"expected stale UDP services length %d, got %v"
,
len
(
expectedStaleUDPServices
),
result
.
staleServices
.
List
())
t
.
Errorf
(
"expected stale UDP services length %d, got %v"
,
len
(
expectedStaleUDPServices
),
result
.
staleServices
.
Unsorted
List
())
}
for
_
,
ip
:=
range
expectedStaleUDPServices
{
if
!
result
.
staleServices
.
Has
(
ip
)
{
...
...
@@ -1166,7 +1166,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) {
t
.
Errorf
(
"expected healthcheck ports length 1, got %v"
,
result
.
hcServices
)
}
if
len
(
result
.
staleServices
)
!=
0
{
t
.
Errorf
(
"expected stale UDP services length 0, got %v"
,
result
.
staleServices
.
List
())
t
.
Errorf
(
"expected stale UDP services length 0, got %v"
,
result
.
staleServices
.
Unsorted
List
())
}
// No change; make sure the service map stays the same and there are
...
...
@@ -1180,7 +1180,7 @@ func TestBuildServiceMapServiceUpdate(t *testing.T) {
t
.
Errorf
(
"expected healthcheck ports length 1, got %v"
,
result
.
hcServices
)
}
if
len
(
result
.
staleServices
)
!=
0
{
t
.
Errorf
(
"expected stale UDP services length 0, got %v"
,
result
.
staleServices
.
List
())
t
.
Errorf
(
"expected stale UDP services length 0, got %v"
,
result
.
staleServices
.
Unsorted
List
())
}
// And back to ClusterIP
...
...
pkg/proxy/ipvs/proxier.go
View file @
83ada5c7
...
...
@@ -673,7 +673,7 @@ func CanUseIPVSProxier() (bool, error) {
loadModules
:=
sets
.
NewString
()
wantModules
.
Insert
(
ipvsModules
...
)
loadModules
.
Insert
(
mods
...
)
modules
:=
wantModules
.
Difference
(
loadModules
)
.
List
()
modules
:=
wantModules
.
Difference
(
loadModules
)
.
Unsorted
List
()
if
len
(
modules
)
!=
0
{
return
false
,
fmt
.
Errorf
(
"IPVS proxier will not be used because the following required kernel modules are not loaded: %v"
,
modules
)
}
...
...
@@ -1254,7 +1254,7 @@ func (proxier *Proxier) syncProxyRules() {
// Finish housekeeping.
// TODO: these could be made more consistent.
for
_
,
svcIP
:=
range
staleServices
.
List
()
{
for
_
,
svcIP
:=
range
staleServices
.
Unsorted
List
()
{
if
err
:=
utilproxy
.
ClearUDPConntrackForIP
(
proxier
.
exec
,
svcIP
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to delete stale service IP %s connections, error: %v"
,
svcIP
,
err
)
}
...
...
@@ -1339,7 +1339,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
if
!
curEndpoints
.
Equal
(
newEndpoints
)
{
// Create new endpoints
for
_
,
ep
:=
range
newEndpoints
.
Difference
(
curEndpoints
)
.
List
()
{
for
_
,
ep
:=
range
newEndpoints
.
Difference
(
curEndpoints
)
.
Unsorted
List
()
{
ip
,
port
,
err
:=
net
.
SplitHostPort
(
ep
)
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to parse endpoint: %v, error: %v"
,
ep
,
err
)
...
...
@@ -1363,7 +1363,7 @@ func (proxier *Proxier) syncEndpoint(svcPortName proxy.ServicePortName, onlyNode
}
}
// Delete old endpoints
for
_
,
ep
:=
range
curEndpoints
.
Difference
(
newEndpoints
)
.
List
()
{
for
_
,
ep
:=
range
curEndpoints
.
Difference
(
newEndpoints
)
.
Unsorted
List
()
{
ip
,
port
,
err
:=
net
.
SplitHostPort
(
ep
)
if
err
!=
nil
{
glog
.
Errorf
(
"Failed to parse endpoint: %v, error: %v"
,
ep
,
err
)
...
...
pkg/proxy/userspace/proxier.go
View file @
83ada5c7
...
...
@@ -503,7 +503,7 @@ func (proxier *Proxier) unmergeService(service *api.Service, existingPorts sets.
}
proxier
.
loadBalancer
.
DeleteService
(
serviceName
)
}
for
_
,
svcIP
:=
range
staleUDPServices
.
List
()
{
for
_
,
svcIP
:=
range
staleUDPServices
.
Unsorted
List
()
{
if
err
:=
utilproxy
.
ClearUDPConntrackForIP
(
proxier
.
exec
,
svcIP
);
err
!=
nil
{
glog
.
Errorf
(
"Failed to delete stale service IP %s connections, error: %v"
,
svcIP
,
err
)
}
...
...
pkg/proxy/winkernel/proxier.go
View file @
83ada5c7
...
...
@@ -1130,7 +1130,7 @@ func (proxier *Proxier) syncProxyRules() {
// Finish housekeeping.
// TODO: these could be made more consistent.
for
_
,
svcIP
:=
range
staleServices
.
List
()
{
for
_
,
svcIP
:=
range
staleServices
.
Unsorted
List
()
{
// TODO : Check if this is required to cleanup stale services here
glog
.
V
(
5
)
.
Infof
(
"Pending delete stale service IP %s connections"
,
svcIP
)
}
...
...
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