Switch issued check to inspect certificate length

Kubernetes-commit: 94fd1d76ca0e8992b000fbb6b1562c11c37df7cb
This commit is contained in:
Jordan Liggitt 2020-05-28 10:48:49 -04:00 committed by Kubernetes Publisher
parent e72c3d3ce2
commit 198e8f5ee4
2 changed files with 4 additions and 1 deletions

View File

@ -374,6 +374,9 @@ func getCurrentCertificateOrBootstrap(
if err != nil {
return nil, false, fmt.Errorf("unable to parse certificate data: %v", err)
}
if len(certs) < 1 {
return nil, false, fmt.Errorf("no cert data found")
}
bootstrapCert.Leaf = certs[0]
if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil {

View File

@ -125,7 +125,7 @@ func WaitForCertificate(ctx context.Context, client certificatesclient.Certifica
}
}
if approved {
if csr.Status.Certificate != nil {
if len(csr.Status.Certificate) > 0 {
klog.V(2).Infof("certificate signing request %s is issued", csr.Name)
return true, nil
}