From c91833f43aaa635ccd7e85f5ce6de652992abc3b Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Thu, 17 Jan 2019 18:29:55 +0000 Subject: [PATCH] Update order status if state changes will retrieving an existing certificate Signed-off-by: James Munnelly --- pkg/controller/acmeorders/sync.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/controller/acmeorders/sync.go b/pkg/controller/acmeorders/sync.go index 07ba96891..a5a36779c 100644 --- a/pkg/controller/acmeorders/sync.go +++ b/pkg/controller/acmeorders/sync.go @@ -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