fix config nil error
This commit is contained in:
@@ -8,11 +8,9 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/devops"
|
||||
esclient "kubesphere.io/kubesphere/pkg/simple/client/elasticsearch"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/k8s"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/ldap"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/mysql"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/openpitrix"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/prometheus"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/redis"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/s2is3"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/servicemesh"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/sonarqube"
|
||||
@@ -28,9 +26,7 @@ type ServerRunOptions struct {
|
||||
ServiceMeshOptions *servicemesh.ServiceMeshOptions
|
||||
MySQLOptions *mysql.MySQLOptions
|
||||
MonitoringOptions *prometheus.PrometheusOptions
|
||||
LdapOptions *ldap.LdapOptions
|
||||
S3Options *s2is3.S3Options
|
||||
RedisOptions *redis.RedisOptions
|
||||
OpenPitrixOptions *openpitrix.OpenPitrixOptions
|
||||
LoggingOptions *esclient.ElasticSearchOptions
|
||||
}
|
||||
@@ -45,9 +41,7 @@ func NewServerRunOptions() *ServerRunOptions {
|
||||
ServiceMeshOptions: servicemesh.NewServiceMeshOptions(),
|
||||
MySQLOptions: mysql.NewMySQLOptions(),
|
||||
MonitoringOptions: prometheus.NewPrometheusOptions(),
|
||||
LdapOptions: ldap.NewLdapOptions(),
|
||||
S3Options: s2is3.NewS3Options(),
|
||||
RedisOptions: redis.NewRedisOptions(),
|
||||
OpenPitrixOptions: openpitrix.NewOpenPitrixOptions(),
|
||||
LoggingOptions: esclient.NewElasticSearchOptions(),
|
||||
}
|
||||
@@ -59,12 +53,10 @@ func (s *ServerRunOptions) Flags() (fss cliflag.NamedFlagSets) {
|
||||
|
||||
s.GenericServerRunOptions.AddFlags(fss.FlagSet("generic"))
|
||||
s.KubernetesOptions.AddFlags(fss.FlagSet("kubernetes"))
|
||||
s.LdapOptions.AddFlags(fss.FlagSet("ldap"))
|
||||
s.MySQLOptions.AddFlags(fss.FlagSet("mysql"))
|
||||
s.DevopsOptions.AddFlags(fss.FlagSet("devops"))
|
||||
s.SonarQubeOptions.AddFlags(fss.FlagSet("sonarqube"))
|
||||
s.S3Options.AddFlags(fss.FlagSet("s3"))
|
||||
s.RedisOptions.AddFlags(fss.FlagSet("redis"))
|
||||
s.OpenPitrixOptions.AddFlags(fss.FlagSet("openpitrix"))
|
||||
s.ServiceMeshOptions.AddFlags(fss.FlagSet("servicemesh"))
|
||||
s.MonitoringOptions.AddFlags(fss.FlagSet("monitoring"))
|
||||
|
||||
@@ -11,9 +11,7 @@ func (s *ServerRunOptions) Validate() []error {
|
||||
errors = append(errors, s.ServiceMeshOptions.Validate()...)
|
||||
errors = append(errors, s.MonitoringOptions.Validate()...)
|
||||
errors = append(errors, s.SonarQubeOptions.Validate()...)
|
||||
errors = append(errors, s.LdapOptions.Validate()...)
|
||||
errors = append(errors, s.S3Options.Validate()...)
|
||||
errors = append(errors, s.RedisOptions.Validate()...)
|
||||
errors = append(errors, s.OpenPitrixOptions.Validate()...)
|
||||
errors = append(errors, s.LoggingOptions.Validate()...)
|
||||
|
||||
|
||||
@@ -162,7 +162,6 @@ func CreateClientSet(conf *apiserverconfig.Config, stopCh <-chan struct{}) error
|
||||
SetS3Options(conf.S3Options).
|
||||
SetOpenPitrixOptions(conf.OpenPitrixOptions).
|
||||
SetPrometheusOptions(conf.MonitoringOptions).
|
||||
SetRedisOptions(conf.RedisOptions).
|
||||
SetKubeSphereOptions(conf.KubeSphereOptions).
|
||||
SetElasticSearchOptions(conf.LoggingOptions)
|
||||
|
||||
@@ -276,8 +275,6 @@ func Complete(s *options.ServerRunOptions) error {
|
||||
KubernetesOptions: s.KubernetesOptions,
|
||||
ServiceMeshOptions: s.ServiceMeshOptions,
|
||||
MonitoringOptions: s.MonitoringOptions,
|
||||
LdapOptions: s.LdapOptions,
|
||||
RedisOptions: s.RedisOptions,
|
||||
S3Options: s.S3Options,
|
||||
OpenPitrixOptions: s.OpenPitrixOptions,
|
||||
LoggingOptions: s.LoggingOptions,
|
||||
@@ -291,8 +288,6 @@ func Complete(s *options.ServerRunOptions) error {
|
||||
ServiceMeshOptions: conf.ServiceMeshOptions,
|
||||
MySQLOptions: conf.MySQLOptions,
|
||||
MonitoringOptions: conf.MonitoringOptions,
|
||||
LdapOptions: conf.LdapOptions,
|
||||
RedisOptions: conf.RedisOptions,
|
||||
S3Options: conf.S3Options,
|
||||
OpenPitrixOptions: conf.OpenPitrixOptions,
|
||||
LoggingOptions: conf.LoggingOptions,
|
||||
|
||||
Reference in New Issue
Block a user