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
df2a1e50
Commit
df2a1e50
authored
Jul 25, 2017
by
allencloud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use demorgans to make startRouteController implementation more readable
Signed-off-by:
allencloud
<
allen.sun@daocloud.io
>
parent
c25a7e6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
+13
-14
core.go
cmd/kube-controller-manager/app/core.go
+13
-14
No files found.
cmd/kube-controller-manager/app/core.go
View file @
df2a1e50
...
@@ -124,23 +124,22 @@ func startRouteController(ctx ControllerContext) (bool, error) {
...
@@ -124,23 +124,22 @@ func startRouteController(ctx ControllerContext) (bool, error) {
if
err
!=
nil
{
if
err
!=
nil
{
glog
.
Warningf
(
"Unsuccessful parsing of cluster CIDR %v: %v"
,
ctx
.
Options
.
ClusterCIDR
,
err
)
glog
.
Warningf
(
"Unsuccessful parsing of cluster CIDR %v: %v"
,
ctx
.
Options
.
ClusterCIDR
,
err
)
}
}
// TODO demorgans
if
!
ctx
.
Options
.
AllocateNodeCIDRs
||
!
ctx
.
Options
.
ConfigureCloudRoutes
{
if
ctx
.
Options
.
AllocateNodeCIDRs
&&
ctx
.
Options
.
ConfigureCloudRoutes
{
if
ctx
.
Cloud
==
nil
{
glog
.
Warning
(
"configure-cloud-routes is set, but no cloud provider specified. Will not configure cloud provider routes."
)
return
false
,
nil
}
else
if
routes
,
ok
:=
ctx
.
Cloud
.
Routes
();
!
ok
{
glog
.
Warning
(
"configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes."
)
return
false
,
nil
}
else
{
routeController
:=
routecontroller
.
New
(
routes
,
ctx
.
ClientBuilder
.
ClientOrDie
(
"route-controller"
),
ctx
.
InformerFactory
.
Core
()
.
V1
()
.
Nodes
(),
ctx
.
Options
.
ClusterName
,
clusterCIDR
)
go
routeController
.
Run
(
ctx
.
Stop
,
ctx
.
Options
.
RouteReconciliationPeriod
.
Duration
)
return
true
,
nil
}
}
else
{
glog
.
Infof
(
"Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v."
,
ctx
.
Options
.
AllocateNodeCIDRs
,
ctx
.
Options
.
ConfigureCloudRoutes
)
glog
.
Infof
(
"Will not configure cloud provider routes for allocate-node-cidrs: %v, configure-cloud-routes: %v."
,
ctx
.
Options
.
AllocateNodeCIDRs
,
ctx
.
Options
.
ConfigureCloudRoutes
)
return
false
,
nil
return
false
,
nil
}
}
if
ctx
.
Cloud
==
nil
{
glog
.
Warning
(
"configure-cloud-routes is set, but no cloud provider specified. Will not configure cloud provider routes."
)
return
false
,
nil
}
routes
,
ok
:=
ctx
.
Cloud
.
Routes
()
if
!
ok
{
glog
.
Warning
(
"configure-cloud-routes is set, but cloud provider does not support routes. Will not configure cloud provider routes."
)
return
false
,
nil
}
routeController
:=
routecontroller
.
New
(
routes
,
ctx
.
ClientBuilder
.
ClientOrDie
(
"route-controller"
),
ctx
.
InformerFactory
.
Core
()
.
V1
()
.
Nodes
(),
ctx
.
Options
.
ClusterName
,
clusterCIDR
)
go
routeController
.
Run
(
ctx
.
Stop
,
ctx
.
Options
.
RouteReconciliationPeriod
.
Duration
)
return
true
,
nil
}
}
func
startPersistentVolumeBinderController
(
ctx
ControllerContext
)
(
bool
,
error
)
{
func
startPersistentVolumeBinderController
(
ctx
ControllerContext
)
(
bool
,
error
)
{
...
...
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