Skip to content

Commit

Permalink
Merge branch 'master' into fix_pd_peer_urls
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Dec 1, 2020
2 parents 6df2551 + 5296e8f commit be4aadf
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/cluster/task/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package task
import (
"encoding/pem"
"fmt"
"net"
"path/filepath"

"github.com/pingcap/errors"
Expand All @@ -38,8 +39,13 @@ func (c *TLSCert) Execute(ctx *Context) error {
if err != nil {
return err
}
// we don't support hostname yet, only iplist is used
csr, err := privKey.CSR(c.inst.Role(), c.inst.ComponentName(), []string{}, []string{c.inst.GetHost()})

hosts := []string{c.inst.GetHost()}
ips := []string{}
if net.ParseIP(c.inst.GetHost()) != nil {
hosts, ips = ips, hosts
}
csr, err := privKey.CSR(c.inst.Role(), c.inst.ComponentName(), hosts, ips)
if err != nil {
return err
}
Expand Down

0 comments on commit be4aadf

Please sign in to comment.