mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
kubeadm: fix missing error handling
Handled error returned from CertificateSigningRequests().Get()
This commit is contained in:
parent
2dc9acc23b
commit
daa111156f
@ -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{})
|
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 {
|
if len(req.Status.Conditions) < 1 {
|
||||||
return nil, nil, errors.New("certificate signing request has no statuses")
|
return nil, nil, errors.New("certificate signing request has no statuses")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user