From 1f3b883cfd1a7a4fb5f00fcdb9e608fc0158d3bc Mon Sep 17 00:00:00 2001 From: James Munnelly Date: Tue, 3 Dec 2019 16:12:14 +0000 Subject: [PATCH] Don't overwrite order.status.url if return Order's URI is empty Signed-off-by: James Munnelly --- pkg/controller/acmeorders/sync.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/controller/acmeorders/sync.go b/pkg/controller/acmeorders/sync.go index 03515a8bf..b0619c0bc 100644 --- a/pkg/controller/acmeorders/sync.go +++ b/pkg/controller/acmeorders/sync.go @@ -231,7 +231,12 @@ func (c *controller) updateOrderStatus(ctx context.Context, cl acmecl.Interface, } log.V(logf.DebugLevel).Info("Retrieved ACME order from server", "raw_data", acmeOrder) - o.Status.URL = acmeOrder.URI + // Workaround bug in golang.org/x/crypto/acme implementation whereby the + // order's URI field will be empty when calling GetOrder due to the + // 'Location' header not being set on the response from the ACME server. + if acmeOrder.URI != "" { + o.Status.URL = acmeOrder.URI + } o.Status.FinalizeURL = acmeOrder.FinalizeURL c.setOrderState(&o.Status, acmeOrder.Status) // only set the authorizations field if the lengths mismatch.