Merge pull request #1240 from munnerz/expired-orders-no-cert

Update order status if state changes while retrieving an existing certificate
This commit is contained in:
jetstack-bot 2019-01-18 14:28:23 +00:00 committed by GitHub
commit 438d0a6775
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,14 @@ func (c *Controller) Sync(ctx context.Context, o *cmapi.Order) (err error) {
return err
}
// If the Order state has actually changed and we've not observed it,
// update the order status and let the change in the resource trigger
// a resync
if acmeOrder.Status != acmeapi.StatusValid {
c.setOrderStatus(&o.Status, acmeOrder)
return nil
}
certs, err := cl.GetCertificate(ctx, acmeOrder.CertificateURL)
if err != nil {
// TODO: mark the order as 'errored' if this is a 404 or similar