Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
086e8acd
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看板
提交
086e8acd
编写于
4月 27, 2019
作者:
R
runzexia
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add header & add some comment && rollback role assign when db insert failed
上级
386e2912
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
207 addition
and
24 deletion
+207
-24
pkg/apiserver/devops/member.go
pkg/apiserver/devops/member.go
+14
-12
pkg/apiserver/devops/project.go
pkg/apiserver/devops/project.go
+13
-0
pkg/apiserver/devops/project_credential.go
pkg/apiserver/devops/project_credential.go
+13
-0
pkg/apiserver/devops/project_pipeline.go
pkg/apiserver/devops/project_pipeline.go
+13
-0
pkg/models/devops/common.go
pkg/models/devops/common.go
+13
-0
pkg/models/devops/membership.go
pkg/models/devops/membership.go
+13
-0
pkg/models/devops/project.go
pkg/models/devops/project.go
+13
-0
pkg/models/devops/project_credential.go
pkg/models/devops/project_credential.go
+13
-0
pkg/models/devops/project_credential_handler.go
pkg/models/devops/project_credential_handler.go
+13
-0
pkg/models/devops/project_handler.go
pkg/models/devops/project_handler.go
+13
-0
pkg/models/devops/project_member_handler.go
pkg/models/devops/project_member_handler.go
+24
-12
pkg/models/devops/project_pipeline.go
pkg/models/devops/project_pipeline.go
+13
-0
pkg/models/devops/project_pipeline_handler.go
pkg/models/devops/project_pipeline_handler.go
+13
-0
pkg/models/devops/project_pipeline_test.go
pkg/models/devops/project_pipeline_test.go
+13
-0
pkg/simple/client/admin_jenkins/jenkins.go
pkg/simple/client/admin_jenkins/jenkins.go
+13
-0
未找到文件。
pkg/apiserver/devops/member.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
@@ -13,18 +27,6 @@ import (
"net/http"
)
/*
Copyright 2018 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
func
GetDevOpsProjectMembersHandler
(
request
*
restful
.
Request
,
resp
*
restful
.
Response
)
{
...
...
pkg/apiserver/devops/project.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/apiserver/devops/project_credential.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/apiserver/devops/project_pipeline.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/common.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/membership.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
const
(
...
...
pkg/models/devops/project.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_credential.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_credential_handler.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_handler.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_member_handler.go
浏览文件 @
086e8acd
/*
Copyright 2018 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
@@ -16,18 +28,7 @@ import (
"kubesphere.io/kubesphere/pkg/simple/client/devops_mysql"
)
/*
Copyright 2018 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
func
GetProjectMembers
(
projectId
string
,
conditions
*
params
.
Conditions
,
orderBy
string
,
reverse
bool
,
limit
int
,
offset
int
)
(
*
models
.
PageableResponse
,
error
)
{
dbconn
:=
devops_mysql
.
OpenDatabase
()
...
...
@@ -111,6 +112,7 @@ func AddProjectMember(projectId, operator string, member *DevOpsProjectMembershi
glog
.
Errorf
(
"%+v"
,
err
)
return
nil
,
restful
.
NewError
(
http
.
StatusInternalServerError
,
err
.
Error
())
}
// if user could be founded in db, user have been added to project
if
err
!=
db
.
ErrNotFound
{
err
=
fmt
.
Errorf
(
"user [%s] have been added to project"
,
member
.
Username
)
glog
.
Errorf
(
"%+v"
,
err
)
...
...
@@ -163,6 +165,16 @@ func AddProjectMember(projectId, operator string, member *DevOpsProjectMembershi
Record
(
projectMembership
)
.
Exec
()
if
err
!=
nil
{
glog
.
Errorf
(
"%+v"
,
err
)
err
=
projectRole
.
UnAssignRole
(
member
.
Username
)
if
err
!=
nil
{
glog
.
Errorf
(
"%+v"
,
err
)
return
nil
,
restful
.
NewError
(
utils
.
GetJenkinsStatusCode
(
err
),
err
.
Error
())
}
err
=
pipelineRole
.
UnAssignRole
(
member
.
Username
)
if
err
!=
nil
{
glog
.
Errorf
(
"%+v"
,
err
)
return
nil
,
restful
.
NewError
(
utils
.
GetJenkinsStatusCode
(
err
),
err
.
Error
())
}
return
nil
,
restful
.
NewError
(
http
.
StatusInternalServerError
,
err
.
Error
())
}
return
projectMembership
,
nil
...
...
pkg/models/devops/project_pipeline.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_pipeline_handler.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/models/devops/project_pipeline_test.go
浏览文件 @
086e8acd
/*
Copyright 2019 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
devops
import
(
...
...
pkg/simple/client/admin_jenkins/jenkins.go
浏览文件 @
086e8acd
/*
Copyright 2018 The KubeSphere Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package
admin_jenkins
import
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录