mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
only use the resolved name if port was zero
This commit is contained in:
parent
1e53dabe30
commit
d1e12cab41
@ -241,8 +241,10 @@ func (s *server) Start(stayUp bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// Use the actual address as baseURL host. This handles the "0" port case.
|
if _, port, err := net.SplitHostPort(s.config.Addr); err != nil || port == "0" {
|
||||||
s.config.BaseURL.Host = listener.Addr().String()
|
// 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 {
|
if s.config.TLSConfig != nil {
|
||||||
return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig.
|
return s.server.ServeTLS(listener, "", "") // Use certs from TLSConfig.
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user