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
690aae1e
Commit
690aae1e
authored
Feb 25, 2016
by
David Oppenheimer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Wait for goroutines creating routes to finish.
parent
38957f8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
routecontroller.go
pkg/controller/route/routecontroller.go
+4
-1
No files found.
pkg/controller/route/routecontroller.go
View file @
690aae1e
...
@@ -75,6 +75,7 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
...
@@ -75,6 +75,7 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
for
_
,
route
:=
range
routes
{
for
_
,
route
:=
range
routes
{
routeMap
[
route
.
TargetInstance
]
=
route
routeMap
[
route
.
TargetInstance
]
=
route
}
}
wg
:=
sync
.
WaitGroup
{}
for
_
,
node
:=
range
nodes
{
for
_
,
node
:=
range
nodes
{
// Skip if the node hasn't been assigned a CIDR yet.
// Skip if the node hasn't been assigned a CIDR yet.
if
node
.
Spec
.
PodCIDR
==
""
{
if
node
.
Spec
.
PodCIDR
==
""
{
...
@@ -89,15 +90,17 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
...
@@ -89,15 +90,17 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
DestinationCIDR
:
node
.
Spec
.
PodCIDR
,
DestinationCIDR
:
node
.
Spec
.
PodCIDR
,
}
}
nameHint
:=
string
(
node
.
UID
)
nameHint
:=
string
(
node
.
UID
)
wg
.
Add
(
1
)
go
func
(
nameHint
string
,
route
*
cloudprovider
.
Route
)
{
go
func
(
nameHint
string
,
route
*
cloudprovider
.
Route
)
{
if
err
:=
rc
.
routes
.
CreateRoute
(
rc
.
clusterName
,
nameHint
,
route
);
err
!=
nil
{
if
err
:=
rc
.
routes
.
CreateRoute
(
rc
.
clusterName
,
nameHint
,
route
);
err
!=
nil
{
glog
.
Errorf
(
"Could not create route %s %s: %v"
,
nameHint
,
route
.
DestinationCIDR
,
err
)
glog
.
Errorf
(
"Could not create route %s %s: %v"
,
nameHint
,
route
.
DestinationCIDR
,
err
)
}
}
wg
.
Done
()
}(
nameHint
,
route
)
}(
nameHint
,
route
)
}
}
nodeCIDRs
[
node
.
Name
]
=
node
.
Spec
.
PodCIDR
nodeCIDRs
[
node
.
Name
]
=
node
.
Spec
.
PodCIDR
}
}
wg
:=
sync
.
WaitGroup
{}
wg
.
Wait
()
for
_
,
route
:=
range
routes
{
for
_
,
route
:=
range
routes
{
if
rc
.
isResponsibleForRoute
(
route
)
{
if
rc
.
isResponsibleForRoute
(
route
)
{
// Check if this route applies to a node we know about & has correct CIDR.
// Check if this route applies to a node we know about & has correct CIDR.
...
...
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