mirror of https://github.com/k3s-io/k3s
only use the resolved name if port was zero
parent
e4ae499aa2
commit
4aba8f111a
|
@ -239,8 +239,10 @@ func (s *server) Start(stayUp bool) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
// Use the actual address as baseURL host. This handles the "0" port case.
|
||||
s.config.BaseURL.Host = listener.Addr().String()
|
||||
if _, port, err := net.SplitHostPort(s.config.Addr); err != nil || port == "0" {
|
||||
// Use the actual address as baseURL host. This handles the "0" port case.
|
||||
s.config.BaseURL.Host = listener.Addr().String()
|
||||
}
|
||||
if s.config.TLSConfig != nil {
|
||||
return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig.
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue