Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
cda4f4f0
K
kubesphere
项目概览
水淹萌龙
/
kubesphere
与 Fork 源项目一致
Fork自
KubeSphere / kubesphere
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
cda4f4f0
编写于
7月 23, 2019
作者:
M
magicsong
提交者:
zryfish
7月 26, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
🚒
add error message in controller
上级
5a836d9d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
21 deletion
+19
-21
Makefile
Makefile
+1
-1
pkg/controller/application/application_controller.go
pkg/controller/application/application_controller.go
+6
-6
pkg/controller/destinationrule/destinationrule_controller.go
pkg/controller/destinationrule/destinationrule_controller.go
+4
-5
pkg/controller/job/job_controller.go
pkg/controller/job/job_controller.go
+4
-5
pkg/controller/virtualservice/virtualservice_controller.go
pkg/controller/virtualservice/virtualservice_controller.go
+4
-4
未找到文件。
Makefile
浏览文件 @
cda4f4f0
...
...
@@ -7,7 +7,7 @@ BIN ?= ks-apiserver
IMG
?=
kubespheredev/ks-apiserver
OUTPUT_DIR
=
bin
GOFLAGS
=
-mod
=
vendor
define
ALL_HELP_INFO
# Build code.
#
...
...
pkg/controller/application/application_controller.go
浏览文件 @
cda4f4f0
...
...
@@ -2,6 +2,8 @@ package application
import
(
"fmt"
"time"
applicationclient
"github.com/kubernetes-sigs/application/pkg/client/clientset/versioned"
applicationinformers
"github.com/kubernetes-sigs/application/pkg/client/informers/externalversions/app/v1beta1"
applicationlister
"github.com/kubernetes-sigs/application/pkg/client/listers/app/v1beta1"
...
...
@@ -25,7 +27,6 @@ import (
servicemeshlisters
"kubesphere.io/kubesphere/pkg/client/listers/servicemesh/v1alpha2"
"kubesphere.io/kubesphere/pkg/controller/virtualservice/util"
logf
"sigs.k8s.io/controller-runtime/pkg/runtime/log"
"time"
)
const
(
...
...
@@ -148,11 +149,10 @@ func NewApplicationController(serviceInformer coreinformers.ServiceInformer,
}
func
(
v
*
ApplicationController
)
Start
(
stopCh
<-
chan
struct
{})
error
{
v
.
Run
(
2
,
stopCh
)
return
nil
return
v
.
Run
(
2
,
stopCh
)
}
func
(
v
*
ApplicationController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
func
(
v
*
ApplicationController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
error
{
defer
utilruntime
.
HandleCrash
()
defer
v
.
queue
.
ShutDown
()
...
...
@@ -160,14 +160,14 @@ func (v *ApplicationController) Run(workers int, stopCh <-chan struct{}) {
defer
log
.
Info
(
"shutting down application controller"
)
if
!
cache
.
WaitForCacheSync
(
stopCh
,
v
.
deploymentSynced
,
v
.
statefulSetSynced
,
v
.
serviceSynced
,
v
.
strategySynced
,
v
.
servicePolicySynced
,
v
.
applicationSynced
)
{
return
return
fmt
.
Errorf
(
"failed to wait for caches to sync"
)
}
for
i
:=
0
;
i
<
workers
;
i
++
{
go
wait
.
Until
(
v
.
worker
,
v
.
workerLoopPeriod
,
stopCh
)
}
<-
stopCh
return
nil
}
func
(
v
*
ApplicationController
)
worker
()
{
...
...
pkg/controller/destinationrule/destinationrule_controller.go
浏览文件 @
cda4f4f0
...
...
@@ -148,12 +148,10 @@ func NewDestinationRuleController(deploymentInformer informersv1.DeploymentInfor
}
func
(
v
*
DestinationRuleController
)
Start
(
stopCh
<-
chan
struct
{})
error
{
v
.
Run
(
5
,
stopCh
)
return
nil
return
v
.
Run
(
5
,
stopCh
)
}
func
(
v
*
DestinationRuleController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
func
(
v
*
DestinationRuleController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
error
{
defer
utilruntime
.
HandleCrash
()
defer
v
.
queue
.
ShutDown
()
...
...
@@ -161,7 +159,7 @@ func (v *DestinationRuleController) Run(workers int, stopCh <-chan struct{}) {
defer
log
.
Info
(
"shutting down destinationrule controller"
)
if
!
cache
.
WaitForCacheSync
(
stopCh
,
v
.
serviceSynced
,
v
.
destinationRuleSynced
,
v
.
deploymentSynced
,
v
.
servicePolicySynced
)
{
return
return
fmt
.
Errorf
(
"failed to wait for caches to sync"
)
}
for
i
:=
0
;
i
<
workers
;
i
++
{
...
...
@@ -169,6 +167,7 @@ func (v *DestinationRuleController) Run(workers int, stopCh <-chan struct{}) {
}
<-
stopCh
return
nil
}
func
(
v
*
DestinationRuleController
)
enqueueService
(
obj
interface
{})
{
...
...
pkg/controller/job/job_controller.go
浏览文件 @
cda4f4f0
...
...
@@ -95,12 +95,10 @@ func NewJobController(jobInformer batchv1informers.JobInformer, client clientset
}
func
(
v
*
JobController
)
Start
(
stopCh
<-
chan
struct
{})
error
{
v
.
Run
(
5
,
stopCh
)
return
nil
return
v
.
Run
(
5
,
stopCh
)
}
func
(
v
*
JobController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
func
(
v
*
JobController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
error
{
defer
utilruntime
.
HandleCrash
()
defer
v
.
queue
.
ShutDown
()
...
...
@@ -108,7 +106,7 @@ func (v *JobController) Run(workers int, stopCh <-chan struct{}) {
defer
log
.
Info
(
"shutting down job controller"
)
if
!
cache
.
WaitForCacheSync
(
stopCh
,
v
.
jobSynced
)
{
return
return
fmt
.
Errorf
(
"failed to wait for caches to sync"
)
}
for
i
:=
0
;
i
<
workers
;
i
++
{
...
...
@@ -116,6 +114,7 @@ func (v *JobController) Run(workers int, stopCh <-chan struct{}) {
}
<-
stopCh
return
nil
}
func
(
v
*
JobController
)
enqueueJob
(
obj
interface
{})
{
...
...
pkg/controller/virtualservice/virtualservice_controller.go
浏览文件 @
cda4f4f0
...
...
@@ -145,11 +145,10 @@ func NewVirtualServiceController(serviceInformer coreinformers.ServiceInformer,
}
func
(
v
*
VirtualServiceController
)
Start
(
stopCh
<-
chan
struct
{})
error
{
v
.
Run
(
5
,
stopCh
)
return
nil
return
v
.
Run
(
5
,
stopCh
)
}
func
(
v
*
VirtualServiceController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
{
func
(
v
*
VirtualServiceController
)
Run
(
workers
int
,
stopCh
<-
chan
struct
{})
error
{
defer
utilruntime
.
HandleCrash
()
defer
v
.
queue
.
ShutDown
()
...
...
@@ -157,7 +156,7 @@ func (v *VirtualServiceController) Run(workers int, stopCh <-chan struct{}) {
defer
log
.
Info
(
"shutting down virtualservice controller"
)
if
!
cache
.
WaitForCacheSync
(
stopCh
,
v
.
serviceSynced
,
v
.
virtualServiceSynced
,
v
.
destinationRuleSynced
,
v
.
strategySynced
)
{
return
return
fmt
.
Errorf
(
"failed to wait for caches to sync"
)
}
for
i
:=
0
;
i
<
workers
;
i
++
{
...
...
@@ -165,6 +164,7 @@ func (v *VirtualServiceController) Run(workers int, stopCh <-chan struct{}) {
}
<-
stopCh
return
nil
}
func
(
v
*
VirtualServiceController
)
enqueueService
(
obj
interface
{})
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录