Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
水淹萌龙
kubesphere
提交
d0dc66cf
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看板
提交
d0dc66cf
编写于
9月 25, 2019
作者:
J
Jeff
提交者:
zryfish
9月 25, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix servicemesh options nil bug
上级
284c0d64
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
48 addition
and
105 deletion
+48
-105
cmd/ks-apiserver/app/server.go
cmd/ks-apiserver/app/server.go
+1
-1
pkg/server/config/config.go
pkg/server/config/config.go
+1
-1
pkg/server/config/config_test.go
pkg/server/config/config_test.go
+3
-3
pkg/simple/client/alerting/options.go
pkg/simple/client/alerting/options.go
+1
-1
pkg/simple/client/devops/options.go
pkg/simple/client/devops/options.go
+4
-9
pkg/simple/client/elasticsearch/options.go
pkg/simple/client/elasticsearch/options.go
+6
-11
pkg/simple/client/k8s/options.go
pkg/simple/client/k8s/options.go
+3
-7
pkg/simple/client/kubesphere/options.go
pkg/simple/client/kubesphere/options.go
+2
-6
pkg/simple/client/ldap/options.go
pkg/simple/client/ldap/options.go
+5
-10
pkg/simple/client/mysql/options.go
pkg/simple/client/mysql/options.go
+6
-10
pkg/simple/client/openpitrix/options.go
pkg/simple/client/openpitrix/options.go
+2
-7
pkg/simple/client/prometheus/options.go
pkg/simple/client/prometheus/options.go
+2
-7
pkg/simple/client/redis/options.go
pkg/simple/client/redis/options.go
+0
-5
pkg/simple/client/s2is3/options.go
pkg/simple/client/s2is3/options.go
+7
-12
pkg/simple/client/servicemesh/options.go
pkg/simple/client/servicemesh/options.go
+3
-8
pkg/simple/client/sonarqube/options.go
pkg/simple/client/sonarqube/options.go
+2
-7
未找到文件。
cmd/ks-apiserver/app/server.go
浏览文件 @
d0dc66cf
...
...
@@ -280,7 +280,7 @@ func Complete(s *options.ServerRunOptions) error {
LoggingOptions
:
s
.
LoggingOptions
,
})
s
=
&
options
.
ServerRunOptions
{
*
s
=
options
.
ServerRunOptions
{
GenericServerRunOptions
:
s
.
GenericServerRunOptions
,
KubernetesOptions
:
conf
.
KubernetesOptions
,
DevopsOptions
:
conf
.
DevopsOptions
,
...
...
pkg/server/config/config.go
浏览文件 @
d0dc66cf
...
...
@@ -91,7 +91,7 @@ func Load() error {
}
}
conf
:=
&
Config
{}
conf
:=
newConfig
()
if
err
:=
viper
.
Unmarshal
(
conf
);
err
!=
nil
{
klog
.
Error
(
fmt
.
Errorf
(
"error unmarshal configuration %v"
,
err
))
return
err
...
...
pkg/server/config/config_test.go
浏览文件 @
d0dc66cf
...
...
@@ -70,8 +70,8 @@ func newTestConfig() *Config {
},
S3Options
:
&
s2is3
.
S3Options
{
Endpoint
:
"http://minio.openpitrix-system.svc"
,
Region
:
"
us-east-1
"
,
DisableSSL
:
tru
e
,
Region
:
""
,
DisableSSL
:
fals
e
,
ForcePathStyle
:
false
,
AccessKeyID
:
"ABCDEFGHIJKLMN"
,
SecretAccessKey
:
"OPQRSTUVWXYZ"
,
...
...
@@ -137,7 +137,7 @@ func cleanTestConfig(t *testing.T) {
func
TestGet
(
t
*
testing
.
T
)
{
conf
:=
newTestConfig
()
saveTestConfig
(
t
,
conf
)
//
defer cleanTestConfig(t)
defer
cleanTestConfig
(
t
)
err
:=
Load
()
if
err
!=
nil
{
...
...
pkg/simple/client/alerting/options.go
浏览文件 @
d0dc66cf
package
alerting
type
AlertingOptions
struct
{
Endpoint
string
Endpoint
string
`json:"endpoint" yaml:"endpoint"`
}
func
NewAlertingOptions
()
*
AlertingOptions
{
...
...
pkg/simple/client/devops/options.go
浏览文件 @
d0dc66cf
...
...
@@ -7,10 +7,10 @@ import (
)
type
DevopsOptions
struct
{
Host
string
`json:",omitempty" yaml:"
,omitempty
" description:"Jenkins service host address"`
Username
string
`json:",omitempty" yaml:"
,omitempty
" description:"Jenkins admin username"`
Password
string
`json:",omitempty" yaml:"
,omitempty
" description:"Jenkins admin password"`
MaxConnections
int
`json:"maxConnections,omitempty" yaml:"maxConnections
,omitempty
" description:"Maximum connections allowed to connect to Jenkins"`
Host
string
`json:",omitempty" yaml:"
host
" description:"Jenkins service host address"`
Username
string
`json:",omitempty" yaml:"
username
" description:"Jenkins admin username"`
Password
string
`json:",omitempty" yaml:"
password
" description:"Jenkins admin password"`
MaxConnections
int
`json:"maxConnections,omitempty" yaml:"maxConnections" description:"Maximum connections allowed to connect to Jenkins"`
}
// NewDevopsOptions returns a `zero` instance
...
...
@@ -25,11 +25,6 @@ func NewDevopsOptions() *DevopsOptions {
// ApplyTo apply configuration to another options
func
(
s
*
DevopsOptions
)
ApplyTo
(
options
*
DevopsOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
Host
!=
""
{
reflectutils
.
Override
(
options
,
s
)
}
...
...
pkg/simple/client/elasticsearch/options.go
浏览文件 @
d0dc66cf
...
...
@@ -6,12 +6,12 @@ import (
)
type
ElasticSearchOptions
struct
{
Host
string
`json:"host
,omitempty" yaml:"host,omitempty
"`
LogstashFormat
bool
`json:"logstashFormat
,omitempty" yaml:"logstashFormat,omitempty
"`
Index
string
`json:"
,omitempty" yaml:",omitempty
"`
LogstashPrefix
string
`json:"logstashPrefix,omitempty" yaml:"logstashPrefix
,omitempty
"`
Match
string
`json:"
,omitempty" yaml:",omitempty
"`
Version
string
`json:"
,omitempty" yaml:",omitempty
"`
Host
string
`json:"host
" yaml:"host
"`
LogstashFormat
bool
`json:"logstashFormat
" yaml:"logstashFormat
"`
Index
string
`json:"
index" yaml:"index
"`
LogstashPrefix
string
`json:"logstashPrefix,omitempty" yaml:"logstashPrefix"`
Match
string
`json:"
match" yaml:"match
"`
Version
string
`json:"
version" yaml:"version
"`
}
func
NewElasticSearchOptions
()
*
ElasticSearchOptions
{
...
...
@@ -26,11 +26,6 @@ func NewElasticSearchOptions() *ElasticSearchOptions {
}
func
(
s
*
ElasticSearchOptions
)
ApplyTo
(
options
*
ElasticSearchOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
Host
!=
""
{
reflectutils
.
Override
(
options
,
s
)
}
...
...
pkg/simple/client/k8s/options.go
浏览文件 @
d0dc66cf
...
...
@@ -14,15 +14,15 @@ type KubernetesOptions struct {
// kubernetes apiserver public address, used to generate kubeconfig
// for downloading, default to host defined in kubeconfig
// +optional
Master
string
`json:"master,omitempty" yaml:"master
,omitempty
"`
Master
string
`json:"master,omitempty" yaml:"master"`
// kubernetes clientset qps
// +optional
QPS
float32
`json:"qps,omitemtpy" yaml:"qps
,omitempty
"`
QPS
float32
`json:"qps,omitemtpy" yaml:"qps"`
// kubernetes clientset burst
// +optional
Burst
int
`json:"burst,omitempty" yaml:"burst
,omitempty
"`
Burst
int
`json:"burst,omitempty" yaml:"burst"`
}
// NewKubernetesOptions returns a `zero` instance
...
...
@@ -46,10 +46,6 @@ func (k *KubernetesOptions) Validate() []error {
}
func
(
k
*
KubernetesOptions
)
ApplyTo
(
options
*
KubernetesOptions
)
{
if
options
==
nil
{
options
=
k
return
}
reflectutils
.
Override
(
options
,
k
)
}
...
...
pkg/simple/client/kubesphere/options.go
浏览文件 @
d0dc66cf
...
...
@@ -3,8 +3,8 @@ package kubesphere
import
"github.com/spf13/pflag"
type
KubeSphereOptions
struct
{
APIServer
string
AccountServer
string
APIServer
string
`json:"apiServer" yaml:"apiServer"`
AccountServer
string
`json:"accountServer" yaml:"accountServer"`
}
// NewKubeSphereOptions create a default options
...
...
@@ -16,10 +16,6 @@ func NewKubeSphereOptions() *KubeSphereOptions {
}
func
(
s
*
KubeSphereOptions
)
ApplyTo
(
options
*
KubeSphereOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
AccountServer
!=
""
{
options
.
AccountServer
=
s
.
AccountServer
}
...
...
pkg/simple/client/ldap/options.go
浏览文件 @
d0dc66cf
...
...
@@ -6,11 +6,11 @@ import (
)
type
LdapOptions
struct
{
Host
string
`json:"host,omitempty" yaml:"host
,omitempty
"`
ManagerDN
string
`json:"managerDN,omitempty" yaml:"managerDN
,omitempty
"`
ManagerPassword
string
`json:"managerPassword,omitempty" yaml:"managerPassword
,omitempty
"`
UserSearchBase
string
`json:"userSearchBase,omitempty" yaml:"userSearchBase
,omitempty
"`
GroupSearchBase
string
`json:"groupSearchBase,omitempty" yaml:"groupSearchBase
,omitempty
"`
Host
string
`json:"host,omitempty" yaml:"host"`
ManagerDN
string
`json:"managerDN,omitempty" yaml:"managerDN"`
ManagerPassword
string
`json:"managerPassword,omitempty" yaml:"managerPassword"`
UserSearchBase
string
`json:"userSearchBase,omitempty" yaml:"userSearchBase"`
GroupSearchBase
string
`json:"groupSearchBase,omitempty" yaml:"groupSearchBase"`
}
// NewLdapOptions return a default option
...
...
@@ -31,11 +31,6 @@ func (l *LdapOptions) Validate() []error {
}
func
(
l
*
LdapOptions
)
ApplyTo
(
options
*
LdapOptions
)
{
if
options
==
nil
{
options
=
l
return
}
if
l
.
Host
!=
""
{
reflectutils
.
Override
(
options
,
l
)
}
...
...
pkg/simple/client/mysql/options.go
浏览文件 @
d0dc66cf
...
...
@@ -7,12 +7,12 @@ import (
)
type
MySQLOptions
struct
{
Host
string
`json:"host,omitempty" yaml:"host
,omitempty
" description:"MySQL service host address"`
Username
string
`json:"username,omitempty" yaml:"username
,omitempty
"`
Password
string
`json:"-" yaml:"password
,omitempty
"`
MaxIdleConnections
int
`json:"maxIdleConnections,omitempty" yaml:"maxIdleConnections
,omitempty
"`
MaxOpenConnections
int
`json:"maxOpenConnections,omitempty" yaml:"maxOpenConnections
,omitempty
"`
MaxConnectionLifeTime
time
.
Duration
`json:"maxConnectionLifeTime,omitempty" yaml:"maxConnectionLifeTime
,omitempty
"`
Host
string
`json:"host,omitempty" yaml:"host" description:"MySQL service host address"`
Username
string
`json:"username,omitempty" yaml:"username"`
Password
string
`json:"-" yaml:"password"`
MaxIdleConnections
int
`json:"maxIdleConnections,omitempty" yaml:"maxIdleConnections"`
MaxOpenConnections
int
`json:"maxOpenConnections,omitempty" yaml:"maxOpenConnections"`
MaxConnectionLifeTime
time
.
Duration
`json:"maxConnectionLifeTime,omitempty" yaml:"maxConnectionLifeTime"`
}
// NewMySQLOptions create a `zero` value instance
...
...
@@ -34,10 +34,6 @@ func (m *MySQLOptions) Validate() []error {
}
func
(
m
*
MySQLOptions
)
ApplyTo
(
options
*
MySQLOptions
)
{
if
options
==
nil
{
options
=
m
return
}
reflectutils
.
Override
(
options
,
m
)
}
...
...
pkg/simple/client/openpitrix/options.go
浏览文件 @
d0dc66cf
...
...
@@ -7,8 +7,8 @@ import (
)
type
OpenPitrixOptions
struct
{
APIServer
string
`json:"apiServer,omitempty" yaml:"apiServer
,omitempty
"`
Token
string
`json:"token,omitempty" yaml:"token
,omitempty
"`
APIServer
string
`json:"apiServer,omitempty" yaml:"apiServer"`
Token
string
`json:"token,omitempty" yaml:"token"`
}
func
NewOpenPitrixOptions
()
*
OpenPitrixOptions
{
...
...
@@ -19,11 +19,6 @@ func NewOpenPitrixOptions() *OpenPitrixOptions {
}
func
(
s
*
OpenPitrixOptions
)
ApplyTo
(
options
*
OpenPitrixOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
APIServer
!=
""
{
reflectutils
.
Override
(
options
,
s
)
}
...
...
pkg/simple/client/prometheus/options.go
浏览文件 @
d0dc66cf
...
...
@@ -5,8 +5,8 @@ import (
)
type
PrometheusOptions
struct
{
Endpoint
string
`json:"endpoint,omitempty" yaml:"endpoint
,omitempty
"`
SecondaryEndpoint
string
`json:"secondaryEndpoint,omitempty" yaml:"secondaryEndpoint
,omitempty
"`
Endpoint
string
`json:"endpoint,omitempty" yaml:"endpoint"`
SecondaryEndpoint
string
`json:"secondaryEndpoint,omitempty" yaml:"secondaryEndpoint"`
}
func
NewPrometheusOptions
()
*
PrometheusOptions
{
...
...
@@ -23,11 +23,6 @@ func (s *PrometheusOptions) Validate() []error {
}
func
(
s
*
PrometheusOptions
)
ApplyTo
(
options
*
PrometheusOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
Endpoint
!=
""
{
options
.
Endpoint
=
s
.
Endpoint
}
...
...
pkg/simple/client/redis/options.go
浏览文件 @
d0dc66cf
...
...
@@ -44,11 +44,6 @@ func (r *RedisOptions) Validate() []error {
// ApplyTo apply to another options if it's a enabled option(non empty host)
func
(
r
*
RedisOptions
)
ApplyTo
(
options
*
RedisOptions
)
{
if
options
==
nil
{
options
=
r
return
}
if
r
.
Host
!=
""
{
reflectutils
.
Override
(
options
,
r
)
}
...
...
pkg/simple/client/s2is3/options.go
浏览文件 @
d0dc66cf
...
...
@@ -7,14 +7,14 @@ import (
// S3Options contains configuration to access a s3 service
type
S3Options
struct
{
Endpoint
string
`json:"endpoint,omitempty" yaml:"endpoint
,omitempty
"`
Region
string
`json:"region,omitempty" yaml:"region
,omitempty
"`
Endpoint
string
`json:"endpoint,omitempty" yaml:"endpoint"`
Region
string
`json:"region,omitempty" yaml:"region"`
DisableSSL
bool
`json:"disableSSL" yaml:"disableSSL"`
ForcePathStyle
bool
`json:"forcePathStyle" yaml:"forePathStyle"`
AccessKeyID
string
`json:"accessKeyID,omitempty" yaml:"accessKeyID
,omitempty
"`
SecretAccessKey
string
`json:"secretAccessKey,omitempty" yaml:"secretAccessKey
,omitempty
"`
SessionToken
string
`json:"sessionToken,omitempty" yaml:"sessionToken
,omitempty
"`
Bucket
string
`json:"bucket,omitempty" yaml:"bucket
,omitempty
"`
ForcePathStyle
bool
`json:"forcePathStyle" yaml:"for
c
ePathStyle"`
AccessKeyID
string
`json:"accessKeyID,omitempty" yaml:"accessKeyID"`
SecretAccessKey
string
`json:"secretAccessKey,omitempty" yaml:"secretAccessKey"`
SessionToken
string
`json:"sessionToken,omitempty" yaml:"sessionToken"`
Bucket
string
`json:"bucket,omitempty" yaml:"bucket"`
}
// NewS3Options creates a default disabled S3Options(empty endpoint)
...
...
@@ -40,11 +40,6 @@ func (s *S3Options) Validate() []error {
// ApplyTo overrides options if it's valid, which endpoint is not empty
func
(
s
*
S3Options
)
ApplyTo
(
options
*
S3Options
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
Endpoint
!=
""
{
reflectutils
.
Override
(
options
,
s
)
}
...
...
pkg/simple/client/servicemesh/options.go
浏览文件 @
d0dc66cf
...
...
@@ -5,13 +5,13 @@ import "github.com/spf13/pflag"
type
ServiceMeshOptions
struct
{
// istio pilot discovery service url
IstioPilotHost
string
`json:"istioPilotHost,omitempty" yaml:"istioPilotHost
,omitempty
"`
IstioPilotHost
string
`json:"istioPilotHost,omitempty" yaml:"istioPilotHost"`
// jaeger query service url
JaegerQueryHost
string
`json:"jaegerQueryHost,omitempty" yaml:"jaegerQueryHost
,omitempty
"`
JaegerQueryHost
string
`json:"jaegerQueryHost,omitempty" yaml:"jaegerQueryHost"`
// prometheus service url for servicemesh metrics
ServicemeshPrometheusHost
string
`json:"servicemeshPrometheusHost,omitempty" yaml:"servicemeshPrometheusHost
,omitempty
"`
ServicemeshPrometheusHost
string
`json:"servicemeshPrometheusHost,omitempty" yaml:"servicemeshPrometheusHost"`
}
// NewServiceMeshOptions returns a `zero` instance
...
...
@@ -30,11 +30,6 @@ func (s *ServiceMeshOptions) Validate() []error {
}
func
(
s
*
ServiceMeshOptions
)
ApplyTo
(
options
*
ServiceMeshOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
ServicemeshPrometheusHost
!=
""
{
options
.
ServicemeshPrometheusHost
=
s
.
ServicemeshPrometheusHost
}
...
...
pkg/simple/client/sonarqube/options.go
浏览文件 @
d0dc66cf
...
...
@@ -5,8 +5,8 @@ import (
)
type
SonarQubeOptions
struct
{
Host
string
`json:",omitempty" yaml:"
,omitempty
" description:"SonarQube service host address"`
Token
string
`json:",omitempty" yaml:"
,omitempty
" description:"SonarQube service token"`
Host
string
`json:",omitempty" yaml:"
host
" description:"SonarQube service host address"`
Token
string
`json:",omitempty" yaml:"
token
" description:"SonarQube service token"`
}
func
NewSonarQubeOptions
()
*
SonarQubeOptions
{
...
...
@@ -27,11 +27,6 @@ func (s *SonarQubeOptions) Validate() []error {
}
func
(
s
*
SonarQubeOptions
)
ApplyTo
(
options
*
SonarQubeOptions
)
{
if
options
==
nil
{
options
=
s
return
}
if
s
.
Host
!=
""
{
options
.
Host
=
s
.
Host
options
.
Token
=
s
.
Token
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录