diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/serving.go b/staging/src/k8s.io/apiserver/pkg/server/options/serving.go index 06edf361e91..aa7a9c0ae2a 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/serving.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/serving.go @@ -287,8 +287,7 @@ func (s *SecureServingOptions) MaybeDefaultWithSelfSignedCerts(publicAddress str if !canReadCertAndKey { // add either the bind address or localhost to the valid alternates - bindIP := s.BindAddress.String() - if bindIP == "0.0.0.0" { + if s.BindAddress.IsUnspecified() { alternateDNS = append(alternateDNS, "localhost") } else { alternateIPs = append(alternateIPs, s.BindAddress)