Merge pull request #70056 from bart0sh/PR0035-kubeadm-certsapi-handling-err

kubeadm: fix missing error handling
pull/58/head
k8s-ci-robot 2018-10-23 02:08:40 -07:00 committed by GitHub
commit 6617394faf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -119,6 +119,9 @@ func (r *CertsAPIRenewal) Renew(cfg *certutil.Config) (*x509.Certificate, *rsa.P
}
req, err = r.client.CertificateSigningRequests().Get(req.Name, metav1.GetOptions{})
if err != nil {
return nil, nil, errors.Wrap(err, "couldn't get certificate signing request")
}
if len(req.Status.Conditions) < 1 {
return nil, nil, errors.New("certificate signing request has no statuses")
}