mirror of
https://github.com/kyverno/kyverno.git
synced 2025-03-31 03:45:17 +00:00
fix: remove k8s apiserver from self-generated cert (#3803)
Signed-off-by: Charles-Edouard Brétéché <charled.breteche@gmail.com> Co-authored-by: shuting <shuting@nirmata.com>
This commit is contained in:
parent
13d8a96f92
commit
25c2bf0e1f
1 changed files with 0 additions and 8 deletions
|
@ -129,19 +129,11 @@ func GenerateCertPem(caCert *KeyPair, props CertificateProps, serverIP string, c
|
|||
dnsNames[2] = commonName
|
||||
|
||||
var ips []net.IP
|
||||
apiServerIP := net.ParseIP(props.APIServerHost)
|
||||
if apiServerIP != nil {
|
||||
ips = append(ips, apiServerIP)
|
||||
} else {
|
||||
dnsNames = append(dnsNames, props.APIServerHost)
|
||||
}
|
||||
|
||||
if serverIP != "" {
|
||||
if strings.Contains(serverIP, ":") {
|
||||
host, _, _ := net.SplitHostPort(serverIP)
|
||||
serverIP = host
|
||||
}
|
||||
|
||||
ip := net.ParseIP(serverIP)
|
||||
ips = append(ips, ip)
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue