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
d6b81640
Commit
d6b81640
authored
Feb 12, 2016
by
k8s-merge-robot
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #21012 from cjcullen/handlertest
Auto commit by PR queue bot
parents
0615f520
918b0ef4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
routecontroller.go
pkg/controller/route/routecontroller.go
+4
-0
routecontroller_test.go
pkg/controller/route/routecontroller_test.go
+11
-0
No files found.
pkg/controller/route/routecontroller.go
View file @
d6b81640
...
...
@@ -75,6 +75,10 @@ func (rc *RouteController) reconcile(nodes []api.Node, routes []*cloudprovider.R
routeMap
[
route
.
TargetInstance
]
=
route
}
for
_
,
node
:=
range
nodes
{
// Skip if the node hasn't been assigned a CIDR yet.
if
node
.
Spec
.
PodCIDR
==
""
{
continue
}
// Check if we have a route for this node w/ the correct CIDR.
r
:=
routeMap
[
node
.
Name
]
if
r
==
nil
||
r
.
DestinationCIDR
!=
node
.
Spec
.
PodCIDR
{
...
...
pkg/controller/route/routecontroller_test.go
View file @
d6b81640
...
...
@@ -145,6 +145,17 @@ func TestReconcile(t *testing.T) {
{
cluster
+
"-02"
,
"node-2"
,
"10.120.1.0/24"
},
},
},
// 2 nodes, one node without CIDR assigned.
{
nodes
:
[]
api
.
Node
{
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"node-1"
,
UID
:
"01"
},
Spec
:
api
.
NodeSpec
{
PodCIDR
:
"10.120.0.0/24"
}},
{
ObjectMeta
:
api
.
ObjectMeta
{
Name
:
"node-2"
,
UID
:
"02"
},
Spec
:
api
.
NodeSpec
{
PodCIDR
:
""
}},
},
initialRoutes
:
[]
*
cloudprovider
.
Route
{},
expectedRoutes
:
[]
*
cloudprovider
.
Route
{
{
cluster
+
"-01"
,
"node-1"
,
"10.120.0.0/24"
},
},
},
}
for
i
,
testCase
:=
range
testCases
{
cloud
:=
&
fakecloud
.
FakeCloud
{
RouteMap
:
make
(
map
[
string
]
*
fakecloud
.
FakeRoute
)}
...
...
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