Fix: nil pointer when enable secure port

Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
LiHui
2021-05-18 10:47:10 +08:00
parent c879c0497e
commit e7f7497a39

View File

@@ -215,7 +215,11 @@ func (s *ServerRunOptions) NewAPIServer(stopCh <-chan struct{}) (*apiserver.APIS
if err != nil {
return nil, err
}
server.TLSConfig.Certificates = []tls.Certificate{certificate}
server.TLSConfig = &tls.Config{
Certificates: []tls.Certificate{certificate},
}
server.Addr = fmt.Sprintf(":%d", s.GenericServerRunOptions.SecurePort)
}
sch := scheme.Scheme