提交 27b335a9 编写于 作者: D Duan Jiong

Support ippool configuration status field

Signed-off-by: NDuan Jiong <djduanjiong@gmail.com>
上级 24e3ac86
......@@ -19,6 +19,7 @@ package config
import (
"fmt"
"github.com/spf13/viper"
networkv1alpha1 "kubesphere.io/kubesphere/pkg/apis/network/v1alpha1"
authoptions "kubesphere.io/kubesphere/pkg/apiserver/authentication/options"
authorizationoptions "kubesphere.io/kubesphere/pkg/apiserver/authorization/options"
"kubesphere.io/kubesphere/pkg/simple/client/alerting"
......@@ -166,6 +167,28 @@ func (conf *Config) ToMap() map[string]bool {
continue
}
if name == "network" {
ippoolName := "network.ippool"
nsnpName := "network"
if conf.NetworkOptions == nil {
result[nsnpName] = false
result[ippoolName] = false
} else {
if conf.NetworkOptions.EnableNetworkPolicy {
result[nsnpName] = true
} else {
result[nsnpName] = false
}
if conf.NetworkOptions.IPPoolType == networkv1alpha1.IPPoolTypeNone {
result[ippoolName] = false
} else {
result[ippoolName] = true
}
}
continue
}
if c.Field(i).IsNil() {
result[name] = false
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册