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

@@ -143,9 +143,9 @@ func (s *APIServer) installKubeSphereAPIs() {
urlruntime.Must(servicemeshv1alpha2.AddToContainer(s.container))
}
func (s *APIServer) Run(stopCh <-chan struct{}) error {
func (s *APIServer) Run(stopCh <-chan struct{}) (err error) {
err := s.waitForResourceSync(stopCh)
err = s.waitForResourceSync(stopCh)
if err != nil {
return err
}
@@ -160,10 +160,12 @@ func (s *APIServer) Run(stopCh <-chan struct{}) error {
klog.V(0).Infof("Start listening on %s", s.Server.Addr)
if s.Server.TLSConfig != nil {
return s.Server.ListenAndServeTLS("", "")
err = s.Server.ListenAndServeTLS("", "")
} else {
return s.Server.ListenAndServe()
err = s.Server.ListenAndServe()
}
return err
}
func (s *APIServer) buildHandlerChain() {