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
fe03c663
Commit
fe03c663
authored
Feb 29, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #22094 from alex-mohr/routes
Auto commit by PR queue bot
parents
cf7e6d0f
0816fa20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
gce.go
pkg/cloudprovider/providers/gce/gce.go
+0
-0
routecontroller.go
pkg/controller/route/routecontroller.go
+13
-7
No files found.
pkg/cloudprovider/providers/gce/gce.go
View file @
fe03c663
This diff is collapsed.
Click to expand it.
pkg/controller/route/routecontroller.go
View file @
fe03c663
...
...
@@ -91,28 +91,34 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
}
nameHint
:=
string
(
node
.
UID
)
wg
.
Add
(
1
)
go
func
(
nameHint
string
,
route
*
cloudprovider
.
Route
)
{
glog
.
Infof
(
"Creating route for node %s %s with hint %s"
,
node
.
Name
,
route
.
DestinationCIDR
,
nameHint
)
go
func
(
nodeName
string
,
nameHint
string
,
route
*
cloudprovider
.
Route
,
startTime
time
.
Time
)
{
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 for node %s after %v: %v"
,
nameHint
,
route
.
DestinationCIDR
,
nodeName
,
time
.
Now
()
.
Sub
(
startTime
),
err
)
}
else
{
glog
.
Infof
(
"Created route for node %s %s with hint %s after %v"
,
nodeName
,
route
.
DestinationCIDR
,
nameHint
,
time
.
Now
()
.
Sub
(
startTime
))
}
wg
.
Done
()
}(
n
ameHint
,
route
)
}(
n
ode
.
Name
,
nameHint
,
route
,
time
.
Now
()
)
}
nodeCIDRs
[
node
.
Name
]
=
node
.
Spec
.
PodCIDR
}
wg
.
Wait
()
for
_
,
route
:=
range
routes
{
if
rc
.
isResponsibleForRoute
(
route
)
{
// Check if this route applies to a node we know about & has correct CIDR.
if
nodeCIDRs
[
route
.
TargetInstance
]
!=
route
.
DestinationCIDR
{
wg
.
Add
(
1
)
// Delete the route.
go
func
(
route
*
cloudprovider
.
Route
)
{
glog
.
Infof
(
"Deleting route %s %s"
,
route
.
Name
,
route
.
DestinationCIDR
)
go
func
(
route
*
cloudprovider
.
Route
,
startTime
time
.
Time
)
{
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 after %v: %v"
,
route
.
Name
,
route
.
DestinationCIDR
,
time
.
Now
()
.
Sub
(
startTime
),
err
)
}
else
{
glog
.
Infof
(
"Deleted route %s %s after %v"
,
route
.
Name
,
route
.
DestinationCIDR
,
time
.
Now
()
.
Sub
(
startTime
))
}
wg
.
Done
()
}(
route
)
}(
route
,
time
.
Now
())
}
}
}
...
...
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