Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
KubeSphere
kubesphere
提交
e1e2b6b5
K
kubesphere
项目概览
KubeSphere
/
kubesphere
通知
143
Star
32
Fork
5
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
2
Wiki
分析
仓库
DevOps
项目成员
Pages
K
kubesphere
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
2
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e1e2b6b5
编写于
6月 12, 2020
作者:
Z
Zhengyi Lai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove WeaveScopeHost from network
Signed-off-by:
N
Zhengyi Lai
<
zheng1@yunify.com
>
上级
1055df5f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
2 addition
and
13 deletion
+2
-13
pkg/apiserver/apiserver.go
pkg/apiserver/apiserver.go
+0
-2
pkg/apiserver/config/config.go
pkg/apiserver/config/config.go
+1
-1
pkg/apiserver/config/config_test.go
pkg/apiserver/config/config_test.go
+1
-1
pkg/simple/client/network/options.go
pkg/simple/client/network/options.go
+0
-9
未找到文件。
pkg/apiserver/apiserver.go
浏览文件 @
e1e2b6b5
...
...
@@ -50,7 +50,6 @@ import (
devopsv1alpha3
"kubesphere.io/kubesphere/pkg/kapis/devops/v1alpha3"
iamapi
"kubesphere.io/kubesphere/pkg/kapis/iam/v1alpha2"
monitoringv1alpha3
"kubesphere.io/kubesphere/pkg/kapis/monitoring/v1alpha3"
networkv1alpha2
"kubesphere.io/kubesphere/pkg/kapis/network/v1alpha2"
notificationv1
"kubesphere.io/kubesphere/pkg/kapis/notification/v1"
"kubesphere.io/kubesphere/pkg/kapis/oauth"
openpitrixv1
"kubesphere.io/kubesphere/pkg/kapis/openpitrix/v1"
...
...
@@ -170,7 +169,6 @@ func (s *APIServer) installKubeSphereAPIs() {
urlruntime
.
Must
(
resourcev1alpha3
.
AddToContainer
(
s
.
container
,
s
.
InformerFactory
))
urlruntime
.
Must
(
monitoringv1alpha3
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
(),
s
.
MonitoringClient
,
s
.
InformerFactory
,
s
.
OpenpitrixClient
))
urlruntime
.
Must
(
openpitrixv1
.
AddToContainer
(
s
.
container
,
s
.
InformerFactory
,
s
.
OpenpitrixClient
))
urlruntime
.
Must
(
networkv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
Config
.
NetworkOptions
.
WeaveScopeHost
))
urlruntime
.
Must
(
operationsv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
()))
urlruntime
.
Must
(
resourcesv1alpha2
.
AddToContainer
(
s
.
container
,
s
.
KubernetesClient
.
Kubernetes
(),
s
.
InformerFactory
,
s
.
KubernetesClient
.
Master
()))
...
...
pkg/apiserver/config/config.go
浏览文件 @
e1e2b6b5
...
...
@@ -203,7 +203,7 @@ func (conf *Config) stripEmptyOptions() {
conf
.
OpenPitrixOptions
=
nil
}
if
conf
.
NetworkOptions
!=
nil
&&
conf
.
NetworkOptions
.
WeaveScopeHost
==
""
{
if
conf
.
NetworkOptions
!=
nil
&&
conf
.
NetworkOptions
.
EnableNetworkPolicy
==
false
{
conf
.
NetworkOptions
=
nil
}
...
...
pkg/apiserver/config/config_test.go
浏览文件 @
e1e2b6b5
...
...
@@ -101,7 +101,7 @@ func newTestConfig() (*Config, error) {
AttachmentManagerEndpoint
:
"openpitrix-hyperpitrix.openpitrix-system.svc:9122"
,
},
NetworkOptions
:
&
network
.
Options
{
WeaveScopeHost
:
"weave-scope-app.weave.svc"
,
EnableNetworkPolicy
:
true
,
},
MonitoringOptions
:
&
prometheus
.
Options
{
Endpoint
:
"http://prometheus.kubesphere-monitoring-system.svc"
,
...
...
pkg/simple/client/network/options.go
浏览文件 @
e1e2b6b5
...
...
@@ -3,17 +3,12 @@ package network
import
"github.com/spf13/pflag"
type
Options
struct
{
// weave scope service host
WeaveScopeHost
string
`json:"weaveScopeHost,omitempty" yaml:"weaveScopeHost"`
EnableNetworkPolicy
bool
`json:"enableNetworkPolicy,omitempty" yaml:"enableNetworkPolicy"`
}
// NewNetworkOptions returns a `zero` instance
func
NewNetworkOptions
()
*
Options
{
return
&
Options
{
WeaveScopeHost
:
"weave-scope-app.weave.svc"
,
EnableNetworkPolicy
:
false
,
}
}
...
...
@@ -24,14 +19,10 @@ func (s *Options) Validate() []error {
}
func
(
s
*
Options
)
ApplyTo
(
options
*
Options
)
{
if
s
.
WeaveScopeHost
!=
""
{
options
.
WeaveScopeHost
=
s
.
WeaveScopeHost
}
options
.
EnableNetworkPolicy
=
s
.
EnableNetworkPolicy
}
func
(
s
*
Options
)
AddFlags
(
fs
*
pflag
.
FlagSet
,
c
*
Options
)
{
fs
.
StringVar
(
&
s
.
WeaveScopeHost
,
"weave-scope-host"
,
c
.
WeaveScopeHost
,
"weave scope service host"
)
fs
.
BoolVar
(
&
s
.
EnableNetworkPolicy
,
"enable-network-policy"
,
c
.
EnableNetworkPolicy
,
"This field instructs KubeSphere to enable network policy or not."
)
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录