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:
Kubernetes Prow Robot
2022-02-07 05:25:44 -08:00
committed by GitHub

View File

@@ -563,6 +563,8 @@ func CertificateRequestFromFile(file string) (*x509.CertificateRequest, error) {
// NewCSR creates a new CSR
func NewCSR(cfg CertConfig, key crypto.Signer) (*x509.CertificateRequest, error) {
RemoveDuplicateAltNames(&cfg.AltNames)
template := &x509.CertificateRequest{
Subject: pkix.Name{
CommonName: cfg.CommonName,