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
7ba30afb
Commit
7ba30afb
authored
May 19, 2017
by
Wojciech Tyczynski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix codestyle
parent
758c9666
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
proxier.go
pkg/proxy/iptables/proxier.go
+10
-10
No files found.
pkg/proxy/iptables/proxier.go
View file @
7ba30afb
...
@@ -199,7 +199,7 @@ type endpointsChange struct {
...
@@ -199,7 +199,7 @@ type endpointsChange struct {
}
}
type
endpointsChangeMap
struct
{
type
endpointsChangeMap
struct
{
sync
.
Mutex
lock
sync
.
Mutex
hostname
string
hostname
string
items
map
[
types
.
NamespacedName
]
*
endpointsChange
items
map
[
types
.
NamespacedName
]
*
endpointsChange
}
}
...
@@ -210,7 +210,7 @@ type serviceChange struct {
...
@@ -210,7 +210,7 @@ type serviceChange struct {
}
}
type
serviceChangeMap
struct
{
type
serviceChangeMap
struct
{
sync
.
Mutex
lock
sync
.
Mutex
items
map
[
types
.
NamespacedName
]
*
serviceChange
items
map
[
types
.
NamespacedName
]
*
serviceChange
}
}
...
@@ -225,8 +225,8 @@ func newEndpointsChangeMap(hostname string) endpointsChangeMap {
...
@@ -225,8 +225,8 @@ func newEndpointsChangeMap(hostname string) endpointsChangeMap {
}
}
func
(
ecm
*
endpointsChangeMap
)
update
(
namespacedName
*
types
.
NamespacedName
,
previous
,
current
*
api
.
Endpoints
)
bool
{
func
(
ecm
*
endpointsChangeMap
)
update
(
namespacedName
*
types
.
NamespacedName
,
previous
,
current
*
api
.
Endpoints
)
bool
{
ecm
.
Lock
()
ecm
.
lock
.
Lock
()
defer
ecm
.
Unlock
()
defer
ecm
.
lock
.
Unlock
()
change
,
exists
:=
ecm
.
items
[
*
namespacedName
]
change
,
exists
:=
ecm
.
items
[
*
namespacedName
]
if
!
exists
{
if
!
exists
{
...
@@ -254,8 +254,8 @@ func newServiceChangeMap() serviceChangeMap {
...
@@ -254,8 +254,8 @@ func newServiceChangeMap() serviceChangeMap {
}
}
func
(
scm
*
serviceChangeMap
)
update
(
namespacedName
*
types
.
NamespacedName
,
previous
,
current
*
api
.
Service
)
bool
{
func
(
scm
*
serviceChangeMap
)
update
(
namespacedName
*
types
.
NamespacedName
,
previous
,
current
*
api
.
Service
)
bool
{
scm
.
Lock
()
scm
.
lock
.
Lock
()
defer
scm
.
Unlock
()
defer
scm
.
lock
.
Unlock
()
change
,
exists
:=
scm
.
items
[
*
namespacedName
]
change
,
exists
:=
scm
.
items
[
*
namespacedName
]
if
!
exists
{
if
!
exists
{
...
@@ -664,8 +664,8 @@ func updateServiceMap(
...
@@ -664,8 +664,8 @@ func updateServiceMap(
staleServices
=
sets
.
NewString
()
staleServices
=
sets
.
NewString
()
func
()
{
func
()
{
changes
.
Lock
()
changes
.
lock
.
Lock
()
defer
changes
.
Unlock
()
defer
changes
.
lock
.
Unlock
()
for
_
,
change
:=
range
changes
.
items
{
for
_
,
change
:=
range
changes
.
items
{
existingPorts
:=
serviceMap
.
merge
(
change
.
current
)
existingPorts
:=
serviceMap
.
merge
(
change
.
current
)
serviceMap
.
unmerge
(
change
.
previous
,
existingPorts
,
staleServices
)
serviceMap
.
unmerge
(
change
.
previous
,
existingPorts
,
staleServices
)
...
@@ -741,8 +741,8 @@ func updateEndpointsMap(
...
@@ -741,8 +741,8 @@ func updateEndpointsMap(
staleSet
=
make
(
map
[
endpointServicePair
]
bool
)
staleSet
=
make
(
map
[
endpointServicePair
]
bool
)
func
()
{
func
()
{
changes
.
Lock
()
changes
.
lock
.
Lock
()
defer
changes
.
Unlock
()
defer
changes
.
lock
.
Unlock
()
for
_
,
change
:=
range
changes
.
items
{
for
_
,
change
:=
range
changes
.
items
{
endpointsMap
.
unmerge
(
change
.
previous
)
endpointsMap
.
unmerge
(
change
.
previous
)
endpointsMap
.
merge
(
change
.
current
)
endpointsMap
.
merge
(
change
.
current
)
...
...
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