Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
bf55d23d
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看板
未验证
提交
bf55d23d
编写于
7月 31, 2020
作者:
Z
zryfish
提交者:
GitHub
7月 31, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add missing federated resources (#2728)
Signed-off-by:
N
Jeff
<
zw0948@gmail.com
>
上级
4702beb6
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
86 addition
and
4 deletion
+86
-4
pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go
...resources/v1alpha3/federatedingress/federatedingresses.go
+79
-0
pkg/models/resources/v1alpha3/federatedstatefulset/federatedstatefulsets.go
...es/v1alpha3/federatedstatefulset/federatedstatefulsets.go
+1
-1
pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go
...odels/resources/v1alpha3/networkpolicy/networkpolicies.go
+1
-2
pkg/models/resources/v1alpha3/node/nodes.go
pkg/models/resources/v1alpha3/node/nodes.go
+1
-1
pkg/models/resources/v1alpha3/resource/resource.go
pkg/models/resources/v1alpha3/resource/resource.go
+4
-0
未找到文件。
pkg/models/resources/v1alpha3/federatedingress/federatedingresses.go
0 → 100644
浏览文件 @
bf55d23d
/*
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
federatedingress
import
(
"k8s.io/apimachinery/pkg/runtime"
"kubesphere.io/kubesphere/pkg/api"
"kubesphere.io/kubesphere/pkg/apis/types/v1beta1"
"kubesphere.io/kubesphere/pkg/apiserver/query"
informers
"kubesphere.io/kubesphere/pkg/client/informers/externalversions"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3"
)
type
fedIngressGetter
struct
{
sharedInformers
informers
.
SharedInformerFactory
}
func
New
(
sharedInformers
informers
.
SharedInformerFactory
)
v1alpha3
.
Interface
{
return
&
fedIngressGetter
{
sharedInformers
:
sharedInformers
}
}
func
(
g
*
fedIngressGetter
)
Get
(
namespace
,
name
string
)
(
runtime
.
Object
,
error
)
{
return
g
.
sharedInformers
.
Types
()
.
V1beta1
()
.
FederatedIngresses
()
.
Lister
()
.
FederatedIngresses
(
namespace
)
.
Get
(
name
)
}
func
(
g
*
fedIngressGetter
)
List
(
namespace
string
,
query
*
query
.
Query
)
(
*
api
.
ListResult
,
error
)
{
// first retrieves all deployments within given namespace
ingresses
,
err
:=
g
.
sharedInformers
.
Types
()
.
V1beta1
()
.
FederatedIngresses
()
.
Lister
()
.
FederatedIngresses
(
namespace
)
.
List
(
query
.
Selector
())
if
err
!=
nil
{
return
nil
,
err
}
var
result
[]
runtime
.
Object
for
_
,
ingress
:=
range
ingresses
{
result
=
append
(
result
,
ingress
)
}
return
v1alpha3
.
DefaultList
(
result
,
query
,
g
.
compare
,
g
.
filter
),
nil
}
func
(
g
*
fedIngressGetter
)
compare
(
left
runtime
.
Object
,
right
runtime
.
Object
,
field
query
.
Field
)
bool
{
leftIngress
,
ok
:=
left
.
(
*
v1beta1
.
FederatedIngress
)
if
!
ok
{
return
false
}
rightIngress
,
ok
:=
right
.
(
*
v1beta1
.
FederatedIngress
)
if
!
ok
{
return
false
}
return
v1alpha3
.
DefaultObjectMetaCompare
(
leftIngress
.
ObjectMeta
,
rightIngress
.
ObjectMeta
,
field
)
}
func
(
g
*
fedIngressGetter
)
filter
(
object
runtime
.
Object
,
filter
query
.
Filter
)
bool
{
deployment
,
ok
:=
object
.
(
*
v1beta1
.
FederatedIngress
)
if
!
ok
{
return
false
}
switch
filter
.
Field
{
default
:
return
v1alpha3
.
DefaultObjectMetaFilter
(
deployment
.
ObjectMeta
,
filter
)
}
}
pkg/models/resources/v1alpha3/federatedstatefulset/federatedstatefulsets.go
浏览文件 @
bf55d23d
...
...
@@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/
package
statefulset
package
federated
statefulset
import
(
"k8s.io/apimachinery/pkg/runtime"
...
...
pkg/models/resources/v1alpha3/networkpolicy/networkpolicies.go
浏览文件 @
bf55d23d
...
...
@@ -18,7 +18,6 @@ package networkpolicy
import
(
v1
"k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/informers"
"kubesphere.io/kubesphere/pkg/api"
...
...
@@ -39,7 +38,7 @@ func (n networkpolicyGetter) Get(namespace, name string) (runtime.Object, error)
}
func
(
n
networkpolicyGetter
)
List
(
namespace
string
,
query
*
query
.
Query
)
(
*
api
.
ListResult
,
error
)
{
nps
,
err
:=
n
.
informers
.
Networking
()
.
V1
()
.
NetworkPolicies
()
.
Lister
()
.
NetworkPolicies
(
namespace
)
.
List
(
labels
.
Everything
())
nps
,
err
:=
n
.
informers
.
Networking
()
.
V1
()
.
NetworkPolicies
()
.
Lister
()
.
NetworkPolicies
(
namespace
)
.
List
(
query
.
Selector
())
if
err
!=
nil
{
return
nil
,
err
}
...
...
pkg/models/resources/v1alpha3/node/nodes.go
浏览文件 @
bf55d23d
...
...
@@ -76,7 +76,7 @@ func (c nodesGetter) List(_ string, query *query.Query) (*api.ListResult, error)
}
// ignore the error, skip annotating process if error happened
pods
,
_
:=
c
.
informers
.
Core
()
.
V1
()
.
Pods
()
.
Lister
()
.
Pods
(
""
)
.
List
(
labels
.
Everything
())
pods
,
_
:=
c
.
informers
.
Core
()
.
V1
()
.
Pods
()
.
Lister
()
.
Pods
(
""
)
.
List
(
query
.
Selector
())
var
nonTerminatedPodsList
[]
*
v1
.
Pod
for
_
,
pod
:=
range
pods
{
if
pod
.
Status
.
Phase
!=
v1
.
PodSucceeded
&&
pod
.
Status
.
Phase
!=
v1
.
PodFailed
{
...
...
pkg/models/resources/v1alpha3/resource/resource.go
浏览文件 @
bf55d23d
...
...
@@ -43,10 +43,12 @@ import (
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedapplication"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedconfigmap"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federateddeployment"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedingress"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatednamespace"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedpersistentvolumeclaim"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedsecret"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedservice"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/federatedstatefulset"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/globalrole"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/globalrolebinding"
"kubesphere.io/kubesphere/pkg/models/resources/v1alpha3/ingress"
...
...
@@ -114,6 +116,8 @@ func NewResourceGetter(factory informers.InformerFactory) *ResourceGetter {
getters
[
typesv1beta1
.
SchemeGroupVersion
.
WithResource
(
typesv1beta1
.
ResourcePluralFederatedService
)]
=
federatedservice
.
New
(
factory
.
KubeSphereSharedInformerFactory
())
getters
[
typesv1beta1
.
SchemeGroupVersion
.
WithResource
(
typesv1beta1
.
ResourcePluralFederatedApplication
)]
=
federatedapplication
.
New
(
factory
.
KubeSphereSharedInformerFactory
())
getters
[
typesv1beta1
.
SchemeGroupVersion
.
WithResource
(
typesv1beta1
.
ResourcePluralFederatedPersistentVolumeClaim
)]
=
federatedpersistentvolumeclaim
.
New
(
factory
.
KubeSphereSharedInformerFactory
())
getters
[
typesv1beta1
.
SchemeGroupVersion
.
WithResource
(
typesv1beta1
.
ResourcePluralFederatedStatefulSet
)]
=
federatedstatefulset
.
New
(
factory
.
KubeSphereSharedInformerFactory
())
getters
[
typesv1beta1
.
SchemeGroupVersion
.
WithResource
(
typesv1beta1
.
ResourcePluralFederatedIngress
)]
=
federatedingress
.
New
(
factory
.
KubeSphereSharedInformerFactory
())
return
&
ResourceGetter
{
getters
:
getters
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录