Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
564d39ca
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看板
未验证
提交
564d39ca
编写于
4月 01, 2020
作者:
R
runzexia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
clean codee
上级
30be09e0
变更
4
展开全部
隐藏空白更改
内联
并排
Showing
4 changed file
with
114 addition
and
91 deletion
+114
-91
pkg/apiserver/apiserver.go
pkg/apiserver/apiserver.go
+10
-3
pkg/kapis/devops/v1alpha2/register.go
pkg/kapis/devops/v1alpha2/register.go
+87
-86
pkg/simple/client/sonarqube/interface.go
pkg/simple/client/sonarqube/interface.go
+4
-0
tools/cmd/doc-gen/main.go
tools/cmd/doc-gen/main.go
+13
-2
未找到文件。
pkg/apiserver/apiserver.go
浏览文件 @
564d39ca
...
...
@@ -24,7 +24,9 @@ import (
"kubesphere.io/kubesphere/pkg/apiserver/dispatch"
"kubesphere.io/kubesphere/pkg/apiserver/filters"
"kubesphere.io/kubesphere/pkg/apiserver/request"
ksruntime
"kubesphere.io/kubesphere/pkg/apiserver/runtime"
"kubesphere.io/kubesphere/pkg/informers"
devopsv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2"
iamv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2"
loggingv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/logging/v1alpha2"
monitoringv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha2"
...
...
@@ -47,6 +49,7 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
"kubesphere.io/kubesphere/pkg/simple/client/s3"
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
"net"
"net/http"
rt
"runtime"
...
...
@@ -108,6 +111,8 @@ type APIServer struct {
//
LdapClient
ldap
.
Interface
SonarClient
sonarqube
.
SonarInterface
}
func
(
s
*
APIServer
)
PrepareRun
()
error
{
...
...
@@ -135,18 +140,20 @@ func (s *APIServer) PrepareRun() error {
func
(
s
*
APIServer
)
installKubeSphereAPIs
()
{
urlruntime
.
Must
(
v1alpha2
.
AddToContainer
(
s
.
container
,
s
.
Config
))
urlruntime
.
Must
(
resourcev1alpha3
.
AddToContainer
(
s
.
container
,
s
.
InformerFactory
))
// Need to refactor devops api registration, too much dependencies
//urlruntime.Must(devopsv1alpha2.AddToContainer(s.container, s.DevopsClient, s.DBClient.Database(), nil, s.KubernetesClient.KubeSphere(), s.InformerFactory.KubeSphereSharedInformerFactory(), s.S3Client))
urlruntime
.
Must
(
loggingv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
,
s
.
LoggingClient
))
urlruntime
.
Must
(
monitoringv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
,
s
.
MonitoringClient
))
urlruntime
.
Must
(
openpitrixv1
.
AddToContainer
(
s
.
container
,
s
.
InformerFactory
,
s
.
OpenpitrixClient
))
urlruntime
.
Must
(
operationsv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
()))
urlruntime
.
Must
(
resourcesv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
(),
s
.
InformerFactory
))
//urlruntime.Must(tenantv1alpha2.AddToContainer(s.container, s.KubernetesClient, s.InformerFactory, s.DBClient.Database()))
urlruntime
.
Must
(
terminalv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
(),
s
.
KubernetesClient
.
Config
()))
urlruntime
.
Must
(
iamv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
,
s
.
InformerFactory
,
s
.
LdapClient
,
s
.
CacheClient
,
s
.
Config
.
AuthenticationOptions
))
urlruntime
.
Must
(
oauth
.
AddToContainer
(
s
.
container
,
token
.
NewJwtTokenIssuer
(
token
.
DefaultIssuerName
,
s
.
Config
.
AuthenticationOptions
,
s
.
CacheClient
),
s
.
Config
.
AuthenticationOptions
))
urlruntime
.
Must
(
servicemeshv1alpha2
.
AddToContainer
(
s
.
container
))
devopsv1alpha2Service
:=
ksruntime
.
NewWebService
(
devopsv1alpha2
.
GroupVersion
)
urlruntime
.
Must
(
devopsv1alpha2
.
AddPipelineToWebService
(
devopsv1alpha2Service
,
s
.
DevopsClient
,
s
.
DBClient
.
Database
()))
urlruntime
.
Must
(
devopsv1alpha2
.
AddS2IToWebService
(
devopsv1alpha2Service
,
s
.
KubernetesClient
.
KubeSphere
(),
s
.
InformerFactory
.
KubeSphereSharedInformerFactory
(),
s
.
S3Client
))
urlruntime
.
Must
(
devopsv1alpha2
.
AddSonarToWebService
(
devopsv1alpha2Service
,
s
.
DevopsClient
,
s
.
DBClient
.
Database
(),
s
.
SonarClient
))
s
.
container
.
Add
(
devopsv1alpha2Service
)
}
func
(
s
*
APIServer
)
Run
(
stopCh
<-
chan
struct
{})
(
err
error
)
{
...
...
pkg/kapis/devops/v1alpha2/register.go
浏览文件 @
564d39ca
此差异已折叠。
点击以展开。
pkg/simple/client/sonarqube/interface.go
浏览文件 @
564d39ca
...
...
@@ -14,6 +14,10 @@ type sonarQube struct {
client
*
sonargo
.
Client
}
func
NewSonar
(
client
*
sonargo
.
Client
)
*
sonarQube
{
return
&
sonarQube
{
client
:
client
}
}
const
(
SonarAnalysisActionClass
=
"hudson.plugins.sonar.action.SonarAnalysisAction"
SonarMetricKeys
=
"alert_status,quality_gate_details,bugs,new_bugs,reliability_rating,new_reliability_rating,vulnerabilities,new_vulnerabilities,security_rating,new_security_rating,code_smells,new_code_smells,sqale_rating,new_maintainability_rating,sqale_index,new_technical_debt,coverage,new_coverage,new_lines_to_cover,tests,duplicated_lines_density,new_duplicated_lines_density,duplicated_blocks,ncloc,ncloc_language_distribution,projects,new_lines"
...
...
tools/cmd/doc-gen/main.go
浏览文件 @
564d39ca
...
...
@@ -28,6 +28,8 @@ import (
"io/ioutil"
urlruntime
"k8s.io/apimachinery/pkg/util/runtime"
"kubesphere.io/kubesphere/pkg/apiserver/runtime"
fakeksClient
"kubesphere.io/kubesphere/pkg/client/clientset/versioned/fake"
"kubesphere.io/kubesphere/pkg/client/informers/externalversions"
"kubesphere.io/kubesphere/pkg/constants"
devopsv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha2"
iamv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2"
...
...
@@ -40,7 +42,12 @@ import (
metricsv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/servicemesh/metrics/v1alpha2"
tenantv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/tenant/v1alpha2"
terminalv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/terminal/v1alpha2"
"kubesphere.io/kubesphere/pkg/simple/client/devops/fake"
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
fakes3
"kubesphere.io/kubesphere/pkg/simple/client/s3/fake"
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
"log"
"time"
)
var
output
string
...
...
@@ -57,8 +64,12 @@ func main() {
func
generateSwaggerJson
()
{
container
:=
runtime
.
Container
urlruntime
.
Must
(
devopsv1alpha2
.
AddToContainer
(
container
,
nil
,
nil
,
nil
,
nil
,
nil
,
nil
))
devopsv1alpha2Service
:=
runtime
.
NewWebService
(
devopsv1alpha2
.
GroupVersion
)
urlruntime
.
Must
(
devopsv1alpha2
.
AddPipelineToWebService
(
devopsv1alpha2Service
,
&
fake
.
Devops
{},
&
mysql
.
Database
{}))
urlruntime
.
Must
(
devopsv1alpha2
.
AddS2IToWebService
(
devopsv1alpha2Service
,
fakeksClient
.
NewSimpleClientset
(),
externalversions
.
NewSharedInformerFactory
(
fakeksClient
.
NewSimpleClientset
(),
time
.
Duration
(
0
)),
fakes3
.
NewFakeS3
()))
urlruntime
.
Must
(
devopsv1alpha2
.
AddSonarToWebService
(
devopsv1alpha2Service
,
&
fake
.
Devops
{},
&
mysql
.
Database
{},
sonarqube
.
NewSonar
(
nil
)))
container
.
Add
(
devopsv1alpha2Service
)
urlruntime
.
Must
(
iamv1alpha2
.
AddToContainer
(
container
,
nil
,
nil
,
nil
,
nil
,
nil
))
urlruntime
.
Must
(
loggingv1alpha2
.
AddToContainer
(
container
,
nil
,
nil
))
urlruntime
.
Must
(
monitoringv1alpha2
.
AddToContainer
(
container
,
nil
,
nil
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录