Skip to content

Commit 18cc21e

Browse files
authored
Merge pull request kubernetes#86490 from aojea/ipv6cert
apiserver: add localhost to alternateDNS certificate field if BindAddress is "::"
2 parents 109810d + 29ec87f commit 18cc21e

File tree

1 file changed

+1
-2
lines changed
  • staging/src/k8s.io/apiserver/pkg/server/options

1 file changed

+1
-2
lines changed

staging/src/k8s.io/apiserver/pkg/server/options/serving.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,7 @@ func (s *SecureServingOptions) MaybeDefaultWithSelfSignedCerts(publicAddress str
287287

288288
if !canReadCertAndKey {
289289
// add either the bind address or localhost to the valid alternates
290-
bindIP := s.BindAddress.String()
291-
if bindIP == "0.0.0.0" {
290+
if s.BindAddress.IsUnspecified() {
292291
alternateDNS = append(alternateDNS, "localhost")
293292
} else {
294293
alternateIPs = append(alternateIPs, s.BindAddress)

0 commit comments

Comments
 (0)