Skip to content

Commit e60e3f1

Browse files
TomatoAresCui Shuaijie
andauthored
fix(installer): add console ip to api server certSANs(#1307) (#1479)
Co-authored-by: Cui Shuaijie <arescui@tencent.com>
1 parent d9bd614 commit e60e3f1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

cmd/tke-installer/app/installer/installer.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,14 +1128,18 @@ func (t *TKE) runAfterClusterReady() bool {
11281128

11291129
func (t *TKE) generateCertificates(ctx context.Context) error {
11301130
var dnsNames []string
1131+
ips := []net.IP{net.ParseIP("127.0.0.1")}
11311132
if t.Para.Config.Gateway != nil && t.Para.Config.Gateway.Domain != "" {
1132-
dnsNames = append(dnsNames, t.Para.Config.Gateway.Domain)
1133+
if ip := net.ParseIP(t.Para.Config.Gateway.Domain); ip != nil {
1134+
ips = append(ips, ip)
1135+
} else {
1136+
dnsNames = append(dnsNames, t.Para.Config.Gateway.Domain)
1137+
}
11331138
}
11341139
if t.Para.Config.Registry.TKERegistry != nil {
11351140
dnsNames = append(dnsNames, t.Para.Config.Registry.TKERegistry.Domain, "*."+t.Para.Config.Registry.TKERegistry.Domain)
11361141
}
11371142

1138-
ips := []net.IP{net.ParseIP("127.0.0.1")}
11391143
for _, one := range t.Cluster.Spec.Machines {
11401144
ips = append(ips, net.ParseIP(one.IP))
11411145
}

0 commit comments

Comments
 (0)