mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 11:21:47 +00:00
Merge pull request #107982 from SataQiu/fix-duplicated-altnames
kubeadm: fix the bug that 'kubeadm certs generate-csr' command does not remove duplicated SANs
This commit is contained in:
commit
9f791bbf5b
@ -563,6 +563,8 @@ func CertificateRequestFromFile(file string) (*x509.CertificateRequest, error) {
|
|||||||
|
|
||||||
// NewCSR creates a new CSR
|
// NewCSR creates a new CSR
|
||||||
func NewCSR(cfg CertConfig, key crypto.Signer) (*x509.CertificateRequest, error) {
|
func NewCSR(cfg CertConfig, key crypto.Signer) (*x509.CertificateRequest, error) {
|
||||||
|
RemoveDuplicateAltNames(&cfg.AltNames)
|
||||||
|
|
||||||
template := &x509.CertificateRequest{
|
template := &x509.CertificateRequest{
|
||||||
Subject: pkix.Name{
|
Subject: pkix.Name{
|
||||||
CommonName: cfg.CommonName,
|
CommonName: cfg.CommonName,
|
||||||
|
Loading…
Reference in New Issue
Block a user