Skip to content

Commit

Permalink
Merge pull request #2572 from chaudhryfaisal/custom_certs
Browse files Browse the repository at this point in the history
fix custom certs csr generation for node changes
  • Loading branch information
superseb authored Jul 2, 2021
2 parents 0b27ba6 + 57a2ba0 commit b8e94c9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pki/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,12 @@ func GenerateEtcdCSRs(ctx context.Context, certs map[string]CertificatePKI, rkeC
for _, host := range etcdHosts {
etcdName := GetCrtNameForHost(host, EtcdCertName)
etcdCrt := certs[etcdName].Certificate
etcdCSRPEM := certs[etcdName].CSRPEM
if etcdCSRPEM != "" {
return nil
etcdCsr := certs[etcdName].CSR
if etcdCsr != nil {
if reflect.DeepEqual(etcdAltNames.DNSNames, etcdCsr.DNSNames) &&
DeepEqualIPsAltNames(etcdAltNames.IPs, etcdCsr.IPAddresses) {
continue
}
}
logrus.Infof("[certificates] Generating etcd-%s csr and key", host.InternalAddress)
etcdCSR, etcdKey, err := GenerateCertSigningRequestAndKey(true, EtcdCertName, etcdAltNames, certs[etcdName].Key, nil)
Expand Down Expand Up @@ -532,7 +535,7 @@ func GenerateKubeletCSR(ctx context.Context, certs map[string]CertificatePKI, rk
if oldKubeletCSR != nil &&
reflect.DeepEqual(kubeletAltNames.DNSNames, oldKubeletCSR.DNSNames) &&
DeepEqualIPsAltNames(kubeletAltNames.IPs, oldKubeletCSR.IPAddresses) {
return nil
continue
}
logrus.Infof("[certificates] Generating %s Kubernetes Kubelet csr", kubeletName)
kubeletCSR, kubeletKey, err := GenerateCertSigningRequestAndKey(true, kubeletName, kubeletAltNames, certs[kubeletName].Key, nil)
Expand Down

0 comments on commit b8e94c9

Please sign in to comment.