Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
cc736e47
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看板
未验证
提交
cc736e47
编写于
6月 09, 2020
作者:
K
KubeSphere CI Bot
提交者:
GitHub
6月 09, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #2115 from shaowenchen/fix_query_credential
Fix query credential
上级
5993bdd6
266e85db
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
106 addition
and
31 deletion
+106
-31
pkg/apiserver/apiserver.go
pkg/apiserver/apiserver.go
+2
-0
pkg/kapis/devops/v1alpha3/handler.go
pkg/kapis/devops/v1alpha3/handler.go
+7
-3
pkg/kapis/devops/v1alpha3/register.go
pkg/kapis/devops/v1alpha3/register.go
+16
-4
pkg/models/devops/devops.go
pkg/models/devops/devops.go
+81
-24
未找到文件。
pkg/apiserver/apiserver.go
浏览文件 @
cc736e47
...
...
@@ -366,6 +366,8 @@ func (s *APIServer) waitForResourceSync(stopCh <-chan struct{}) error {
{
Group
:
"devops.kubesphere.io"
,
Version
:
"v1alpha1"
,
Resource
:
"s2ibuildertemplates"
},
{
Group
:
"devops.kubesphere.io"
,
Version
:
"v1alpha1"
,
Resource
:
"s2iruns"
},
{
Group
:
"devops.kubesphere.io"
,
Version
:
"v1alpha1"
,
Resource
:
"s2ibuilders"
},
{
Group
:
"devops.kubesphere.io"
,
Version
:
"v1alpha3"
,
Resource
:
"devopsprojects"
},
{
Group
:
"devops.kubesphere.io"
,
Version
:
"v1alpha3"
,
Resource
:
"pipelines"
},
}
servicemeshGVRs
:=
[]
schema
.
GroupVersionResource
{
...
...
pkg/kapis/devops/v1alpha3/handler.go
浏览文件 @
cc736e47
...
...
@@ -29,6 +29,7 @@ import (
"kubesphere.io/kubesphere/pkg/client/informers/externalversions"
"kubesphere.io/kubesphere/pkg/models/devops"
servererr
"kubesphere.io/kubesphere/pkg/server/errors"
"kubesphere.io/kubesphere/pkg/server/params"
devopsClient
"kubesphere.io/kubesphere/pkg/simple/client/devops"
)
...
...
@@ -67,8 +68,9 @@ func (h *devopsHandler) GetDevOpsProject(request *restful.Request, response *res
func
(
h
*
devopsHandler
)
ListDevOpsProject
(
request
*
restful
.
Request
,
response
*
restful
.
Response
)
{
workspace
:=
request
.
PathParameter
(
"workspace"
)
limit
,
offset
:=
params
.
ParsePaging
(
request
)
projectList
,
err
:=
h
.
devops
.
ListDevOpsProject
(
workspace
)
projectList
,
err
:=
h
.
devops
.
ListDevOpsProject
(
workspace
,
limit
,
offset
)
if
err
!=
nil
{
klog
.
Error
(
err
)
...
...
@@ -176,8 +178,9 @@ func (h *devopsHandler) GetPipeline(request *restful.Request, response *restful.
func
(
h
*
devopsHandler
)
ListPipeline
(
request
*
restful
.
Request
,
response
*
restful
.
Response
)
{
devops
:=
request
.
PathParameter
(
"devops"
)
objs
,
err
:=
h
.
devops
.
ListPipelineObj
(
devops
)
limit
,
offset
:=
params
.
ParsePaging
(
request
)
objs
,
err
:=
h
.
devops
.
ListPipelineObj
(
devops
,
limit
,
offset
)
if
err
!=
nil
{
klog
.
Error
(
err
)
if
errors
.
IsNotFound
(
err
)
{
...
...
@@ -285,8 +288,9 @@ func (h *devopsHandler) GetCredential(request *restful.Request, response *restfu
func
(
h
*
devopsHandler
)
ListCredential
(
request
*
restful
.
Request
,
response
*
restful
.
Response
)
{
devops
:=
request
.
PathParameter
(
"devops"
)
limit
,
offset
:=
params
.
ParsePaging
(
request
)
objs
,
err
:=
h
.
devops
.
ListCredentialObj
(
devops
)
objs
,
err
:=
h
.
devops
.
ListCredentialObj
(
devops
,
limit
,
offset
)
if
err
!=
nil
{
klog
.
Error
(
err
)
...
...
pkg/kapis/devops/v1alpha3/register.go
浏览文件 @
cc736e47
...
...
@@ -31,6 +31,7 @@ import (
kubesphere
"kubesphere.io/kubesphere/pkg/client/clientset/versioned"
"kubesphere.io/kubesphere/pkg/client/informers/externalversions"
"kubesphere.io/kubesphere/pkg/constants"
"kubesphere.io/kubesphere/pkg/server/params"
devopsClient
"kubesphere.io/kubesphere/pkg/simple/client/devops"
"net/http"
)
...
...
@@ -54,8 +55,12 @@ func AddToContainer(container *restful.Container, devopsClient devopsClient.Inte
ws
.
Route
(
ws
.
GET
(
"/devops/{devops}/credentials"
)
.
To
(
handler
.
ListCredential
)
.
Param
(
ws
.
PathParameter
(
"devops"
,
"devops name"
))
.
Param
(
ws
.
QueryParameter
(
params
.
PagingParam
,
"paging query, e.g. limit=100,page=1"
)
.
Required
(
false
)
.
DataFormat
(
"limit=%d,page=%d"
)
.
DefaultValue
(
"limit=10,page=1"
))
.
Doc
(
"list the credentials of the specified devops for the current user"
)
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
[]
v1alpha3
.
PipelineLis
t
{})
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
api
.
ListResul
t
{})
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
[]
string
{
constants
.
DevOpsProjectTag
}))
ws
.
Route
(
ws
.
POST
(
"/devops/{devops}/credentials"
)
.
...
...
@@ -95,8 +100,12 @@ func AddToContainer(container *restful.Container, devopsClient devopsClient.Inte
ws
.
Route
(
ws
.
GET
(
"/devops/{devops}/pipelines"
)
.
To
(
handler
.
ListPipeline
)
.
Param
(
ws
.
PathParameter
(
"devops"
,
"devops name"
))
.
Param
(
ws
.
QueryParameter
(
params
.
PagingParam
,
"paging query, e.g. limit=100,page=1"
)
.
Required
(
false
)
.
DataFormat
(
"limit=%d,page=%d"
)
.
DefaultValue
(
"limit=10,page=1"
))
.
Doc
(
"list the pipelines of the specified devops for the current user"
)
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
[]
v1alpha3
.
PipelineLis
t
{})
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
api
.
ListResul
t
{})
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
[]
string
{
constants
.
DevOpsProjectTag
}))
ws
.
Route
(
ws
.
POST
(
"/devops/{devops}/pipelines"
)
.
...
...
@@ -134,8 +143,11 @@ func AddToContainer(container *restful.Container, devopsClient devopsClient.Inte
ws
.
Route
(
ws
.
GET
(
"/workspaces/{workspace}/devops"
)
.
To
(
handler
.
ListDevOpsProject
)
.
Param
(
ws
.
PathParameter
(
"workspace"
,
"workspace name"
))
.
Doc
(
"List the devopsproject of the specified workspace for the current user"
)
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
[]
v1alpha3
.
DevOpsProjectList
{})
.
Param
(
ws
.
QueryParameter
(
params
.
PagingParam
,
"paging query, e.g. limit=100,page=1"
)
.
Required
(
false
)
.
DataFormat
(
"limit=%d,page=%d"
)
.
DefaultValue
(
"limit=10,page=1"
))
.
Doc
(
"List the devopsproject of the specified workspace for the current user"
)
.
Returns
(
http
.
StatusOK
,
api
.
StatusOK
,
api
.
ListResult
{})
.
Metadata
(
restfulspec
.
KeyOpenAPITags
,
[]
string
{
constants
.
DevOpsProjectTag
}))
ws
.
Route
(
ws
.
POST
(
"/workspaces/{workspace}/devops"
)
.
...
...
pkg/models/devops/devops.go
浏览文件 @
cc736e47
...
...
@@ -24,9 +24,11 @@ import (
"io/ioutil"
v1
"k8s.io/api/core/v1"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/api"
"kubesphere.io/kubesphere/pkg/apis/devops/v1alpha3"
tenantv1alpha1
"kubesphere.io/kubesphere/pkg/apis/tenant/v1alpha1"
kubesphere
"kubesphere.io/kubesphere/pkg/client/clientset/versioned"
...
...
@@ -45,19 +47,19 @@ type DevopsOperator interface {
GetDevOpsProject
(
workspace
string
,
projectName
string
)
(
*
v1alpha3
.
DevOpsProject
,
error
)
DeleteDevOpsProject
(
workspace
string
,
projectName
string
)
error
UpdateDevOpsProject
(
workspace
string
,
project
*
v1alpha3
.
DevOpsProject
)
(
*
v1alpha3
.
DevOpsProject
,
error
)
ListDevOpsProject
(
workspace
string
)
(
*
v1alpha3
.
DevOpsProjectLis
t
,
error
)
ListDevOpsProject
(
workspace
string
,
limit
,
offset
int
)
(
api
.
ListResul
t
,
error
)
CreatePipelineObj
(
projectName
string
,
pipeline
*
v1alpha3
.
Pipeline
)
(
*
v1alpha3
.
Pipeline
,
error
)
GetPipelineObj
(
projectName
string
,
pipelineName
string
)
(
*
v1alpha3
.
Pipeline
,
error
)
DeletePipelineObj
(
projectName
string
,
pipelineName
string
)
error
UpdatePipelineObj
(
projectName
string
,
pipeline
*
v1alpha3
.
Pipeline
)
(
*
v1alpha3
.
Pipeline
,
error
)
ListPipelineObj
(
projectName
string
)
(
*
v1alpha3
.
PipelineLis
t
,
error
)
ListPipelineObj
(
projectName
string
,
limit
,
offset
int
)
(
api
.
ListResul
t
,
error
)
CreateCredentialObj
(
projectName
string
,
s
*
v1
.
Secret
)
(
*
v1
.
Secret
,
error
)
GetCredentialObj
(
projectName
string
,
secretName
string
)
(
*
v1
.
Secret
,
error
)
DeleteCredentialObj
(
projectName
string
,
secretName
string
)
error
UpdateCredentialObj
(
projectName
string
,
secret
*
v1
.
Secret
)
(
*
v1
.
Secret
,
error
)
ListCredentialObj
(
projectName
string
)
(
*
v1
.
SecretLis
t
,
error
)
ListCredentialObj
(
projectName
string
,
limit
,
offset
int
)
(
api
.
ListResul
t
,
error
)
GetPipeline
(
projectName
,
pipelineName
string
,
req
*
http
.
Request
)
(
*
devops
.
Pipeline
,
error
)
ListPipelines
(
req
*
http
.
Request
)
(
*
devops
.
PipelineList
,
error
)
...
...
@@ -146,7 +148,7 @@ func (d devopsOperator) CreateDevOpsProject(workspace string, project *v1alpha3.
}
func
(
d
devopsOperator
)
GetDevOpsProject
(
workspace
string
,
projectName
string
)
(
*
v1alpha3
.
DevOpsProject
,
error
)
{
return
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
return
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
}
func
(
d
devopsOperator
)
DeleteDevOpsProject
(
workspace
string
,
projectName
string
)
error
{
...
...
@@ -158,13 +160,27 @@ func (d devopsOperator) UpdateDevOpsProject(workspace string, project *v1alpha3.
return
d
.
ksclient
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Update
(
project
)
}
func
(
d
devopsOperator
)
ListDevOpsProject
(
workspace
string
)
(
*
v1alpha3
.
DevOpsProjectList
,
error
)
{
return
d
.
ksclient
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
List
(
metav1
.
ListOptions
{})
func
(
d
devopsOperator
)
ListDevOpsProject
(
workspace
string
,
limit
,
offset
int
)
(
api
.
ListResult
,
error
)
{
data
,
err
:=
d
.
ksInformers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
List
(
labels
.
SelectorFromValidatedSet
(
labels
.
Set
{
tenantv1alpha1
.
WorkspaceLabel
:
workspace
}))
if
err
!=
nil
{
return
api
.
ListResult
{},
nil
}
items
:=
make
([]
interface
{},
0
)
var
result
[]
interface
{}
for
_
,
item
:=
range
data
{
result
=
append
(
result
,
*
item
)
}
if
limit
==
-
1
||
limit
+
offset
>
len
(
result
)
{
limit
=
len
(
result
)
-
offset
}
items
=
result
[
offset
:
offset
+
limit
]
return
api
.
ListResult
{
TotalItems
:
len
(
result
),
Items
:
items
},
nil
}
// pipelineobj in crd
func
(
d
devopsOperator
)
CreatePipelineObj
(
projectName
string
,
pipeline
*
v1alpha3
.
Pipeline
)
(
*
v1alpha3
.
Pipeline
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -172,15 +188,15 @@ func (d devopsOperator) CreatePipelineObj(projectName string, pipeline *v1alpha3
}
func
(
d
devopsOperator
)
GetPipelineObj
(
projectName
string
,
pipelineName
string
)
(
*
v1alpha3
.
Pipeline
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
return
d
.
ks
client
.
DevopsV1alpha3
()
.
Pipelines
(
projectObj
.
Status
.
AdminNamespace
)
.
Get
(
pipelineName
,
metav1
.
GetOptions
{}
)
return
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
Pipelines
()
.
Lister
()
.
Pipelines
(
projectObj
.
Status
.
AdminNamespace
)
.
Get
(
pipelineName
)
}
func
(
d
devopsOperator
)
DeletePipelineObj
(
projectName
string
,
pipelineName
string
)
error
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
err
}
...
...
@@ -188,24 +204,38 @@ func (d devopsOperator) DeletePipelineObj(projectName string, pipelineName strin
}
func
(
d
devopsOperator
)
UpdatePipelineObj
(
projectName
string
,
pipeline
*
v1alpha3
.
Pipeline
)
(
*
v1alpha3
.
Pipeline
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
return
d
.
ksclient
.
DevopsV1alpha3
()
.
Pipelines
(
projectObj
.
Status
.
AdminNamespace
)
.
Update
(
pipeline
)
}
func
(
d
devopsOperator
)
ListPipelineObj
(
projectName
string
)
(
*
v1alpha3
.
PipelineLis
t
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
func
(
d
devopsOperator
)
ListPipelineObj
(
projectName
string
,
limit
,
offset
int
)
(
api
.
ListResul
t
,
error
)
{
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
return
api
.
ListResult
{}
,
err
}
return
d
.
ksclient
.
DevopsV1alpha3
()
.
Pipelines
(
projectObj
.
Status
.
AdminNamespace
)
.
List
(
metav1
.
ListOptions
{})
data
,
err
:=
d
.
ksInformers
.
Devops
()
.
V1alpha3
()
.
Pipelines
()
.
Lister
()
.
Pipelines
(
projectObj
.
Status
.
AdminNamespace
)
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
return
api
.
ListResult
{},
nil
}
items
:=
make
([]
interface
{},
0
)
var
result
[]
interface
{}
for
_
,
item
:=
range
data
{
result
=
append
(
result
,
*
item
)
}
if
limit
==
-
1
||
limit
+
offset
>
len
(
result
)
{
limit
=
len
(
result
)
-
offset
}
items
=
result
[
offset
:
offset
+
limit
]
return
api
.
ListResult
{
TotalItems
:
len
(
result
),
Items
:
items
},
nil
}
//credentialobj in crd
func
(
d
devopsOperator
)
CreateCredentialObj
(
projectName
string
,
secret
*
v1
.
Secret
)
(
*
v1
.
Secret
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -213,15 +243,15 @@ func (d devopsOperator) CreateCredentialObj(projectName string, secret *v1.Secre
}
func
(
d
devopsOperator
)
GetCredentialObj
(
projectName
string
,
secretName
string
)
(
*
v1
.
Secret
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
return
d
.
k8s
client
.
CoreV1
()
.
Secrets
(
projectObj
.
Status
.
AdminNamespace
)
.
Get
(
secretName
,
metav1
.
GetOptions
{}
)
return
d
.
k8s
Informers
.
Core
()
.
V1
()
.
Secrets
()
.
Lister
()
.
Secrets
(
projectObj
.
Status
.
AdminNamespace
)
.
Get
(
secretName
)
}
func
(
d
devopsOperator
)
DeleteCredentialObj
(
projectName
string
,
secret
string
)
error
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
err
}
...
...
@@ -229,19 +259,46 @@ func (d devopsOperator) DeleteCredentialObj(projectName string, secret string) e
}
func
(
d
devopsOperator
)
UpdateCredentialObj
(
projectName
string
,
secret
*
v1
.
Secret
)
(
*
v1
.
Secret
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
}
return
d
.
k8sclient
.
CoreV1
()
.
Secrets
(
projectObj
.
Status
.
AdminNamespace
)
.
Update
(
secret
)
}
func
(
d
devopsOperator
)
ListCredentialObj
(
projectName
string
)
(
*
v1
.
SecretLis
t
,
error
)
{
projectObj
,
err
:=
d
.
ks
client
.
DevopsV1alpha3
()
.
DevOpsProjects
()
.
Get
(
projectName
,
metav1
.
GetOptions
{}
)
func
(
d
devopsOperator
)
ListCredentialObj
(
projectName
string
,
limit
,
offset
int
)
(
api
.
ListResul
t
,
error
)
{
projectObj
,
err
:=
d
.
ks
Informers
.
Devops
()
.
V1alpha3
()
.
DevOpsProjects
()
.
Lister
()
.
Get
(
projectName
)
if
err
!=
nil
{
return
nil
,
err
return
api
.
ListResult
{},
err
}
credentialList
,
err
:=
d
.
k8sInformers
.
Core
()
.
V1
()
.
Secrets
()
.
Lister
()
.
Secrets
(
projectObj
.
Status
.
AdminNamespace
)
.
List
(
labels
.
Everything
())
if
err
!=
nil
{
return
api
.
ListResult
{},
err
}
items
:=
make
([]
interface
{},
0
)
var
result
[]
interface
{}
credentialTypeList
:=
[]
v1
.
SecretType
{
v1alpha3
.
SecretTypeBasicAuth
,
v1alpha3
.
SecretTypeSSHAuth
,
v1alpha3
.
SecretTypeSecretText
,
v1alpha3
.
SecretTypeKubeConfig
,
}
for
_
,
credential
:=
range
credentialList
{
for
_
,
credentialType
:=
range
credentialTypeList
{
if
credential
.
Type
==
credentialType
{
result
=
append
(
result
,
*
credential
)
}
}
}
if
limit
==
-
1
||
limit
+
offset
>
len
(
result
)
{
limit
=
len
(
result
)
-
offset
}
return
d
.
k8sclient
.
CoreV1
()
.
Secrets
(
projectObj
.
Status
.
AdminNamespace
)
.
List
(
metav1
.
ListOptions
{})
items
=
result
[
offset
:
offset
+
limit
]
return
api
.
ListResult
{
TotalItems
:
len
(
result
),
Items
:
items
},
nil
}
// others
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录