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
6f73f89f
Commit
6f73f89f
authored
Feb 24, 2016
by
Marcin Wielgus
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21663 from gmarek/route
Wait for all route creation in RouteController
parents
ef2f06f0
b862d2bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
routecontroller.go
pkg/controller/route/routecontroller.go
+5
-0
No files found.
pkg/controller/route/routecontroller.go
View file @
6f73f89f
...
@@ -19,6 +19,7 @@ package route
...
@@ -19,6 +19,7 @@ package route
import
(
import
(
"fmt"
"fmt"
"net"
"net"
"sync"
"time"
"time"
"github.com/golang/glog"
"github.com/golang/glog"
...
@@ -96,19 +97,23 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
...
@@ -96,19 +97,23 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
}
}
nodeCIDRs
[
node
.
Name
]
=
node
.
Spec
.
PodCIDR
nodeCIDRs
[
node
.
Name
]
=
node
.
Spec
.
PodCIDR
}
}
wg
:=
sync
.
WaitGroup
{}
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.
if
nodeCIDRs
[
route
.
TargetInstance
]
!=
route
.
DestinationCIDR
{
if
nodeCIDRs
[
route
.
TargetInstance
]
!=
route
.
DestinationCIDR
{
wg
.
Add
(
1
)
// Delete the route.
// Delete the route.
go
func
(
route
*
cloudprovider
.
Route
)
{
go
func
(
route
*
cloudprovider
.
Route
)
{
if
err
:=
rc
.
routes
.
DeleteRoute
(
rc
.
clusterName
,
route
);
err
!=
nil
{
if
err
:=
rc
.
routes
.
DeleteRoute
(
rc
.
clusterName
,
route
);
err
!=
nil
{
glog
.
Errorf
(
"Could not delete route %s %s: %v"
,
route
.
Name
,
route
.
DestinationCIDR
,
err
)
glog
.
Errorf
(
"Could not delete route %s %s: %v"
,
route
.
Name
,
route
.
DestinationCIDR
,
err
)
}
}
wg
.
Done
()
}(
route
)
}(
route
)
}
}
}
}
}
}
wg
.
Wait
()
return
nil
return
nil
}
}
...
...
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