refactor authentication (#1951)

* refactor authentication

* refactor authentication
This commit is contained in:
zryfish
2020-03-15 23:26:32 +08:00
committed by GitHub
parent eb8a3c0dc6
commit 0a07e5f652
11 changed files with 60 additions and 52 deletions

View File

@@ -156,8 +156,8 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
}
var cacheClient cache.Interface
if s.CacheOptions.RedisURL != "" {
if s.CacheOptions.RedisURL == fakeInterface && s.DebugMode {
if s.CacheOptions.Host != "" {
if s.CacheOptions.Host == fakeInterface && s.DebugMode {
apiServer.CacheClient = cache.NewSimpleCache()
} else {
cacheClient, err = cache.NewRedisClient(s.CacheOptions, stopCh)

View File

@@ -36,16 +36,17 @@ func NewAPIServerCommand() *cobra.Command {
conf, err := apiserverconfig.TryLoadFromDisk()
if err == nil {
s = &options.ServerRunOptions{
KubernetesOptions: conf.KubernetesOptions,
DevopsOptions: conf.DevopsOptions,
SonarQubeOptions: conf.SonarQubeOptions,
ServiceMeshOptions: conf.ServiceMeshOptions,
MySQLOptions: conf.MySQLOptions,
MonitoringOptions: conf.MonitoringOptions,
S3Options: conf.S3Options,
OpenPitrixOptions: conf.OpenPitrixOptions,
LoggingOptions: conf.LoggingOptions,
AuthenticateOptions: conf.AuthenticateOptions,
GenericServerRunOptions: s.GenericServerRunOptions,
KubernetesOptions: conf.KubernetesOptions,
DevopsOptions: conf.DevopsOptions,
SonarQubeOptions: conf.SonarQubeOptions,
ServiceMeshOptions: conf.ServiceMeshOptions,
MySQLOptions: conf.MySQLOptions,
MonitoringOptions: conf.MonitoringOptions,
S3Options: conf.S3Options,
OpenPitrixOptions: conf.OpenPitrixOptions,
LoggingOptions: conf.LoggingOptions,
AuthenticateOptions: conf.AuthenticateOptions,
}
}