Fix apiserver to advertise IPv6 endpoints if bound to IPv6

Also rename utilnet.ChooseBindAddress() to ResolveBindAddress(), to
better describe its functionality.
This commit is contained in:
Dan Winship
2019-10-30 10:46:46 -04:00
parent 08410cbf06
commit afa0b808f8
5 changed files with 68 additions and 41 deletions

View File

@@ -60,7 +60,7 @@ func DefaultAdvertiseAddress(s *genericoptions.ServerRunOptions, insecure *gener
}
if s.AdvertiseAddress == nil || s.AdvertiseAddress.IsUnspecified() {
hostIP, err := utilnet.ChooseBindAddress(insecure.BindAddress)
hostIP, err := utilnet.ResolveBindAddress(insecure.BindAddress)
if err != nil {
return fmt.Errorf("unable to find suitable network address.error='%v'. "+
"Try to set the AdvertiseAddress directly or provide a valid BindAddress to fix this", err)