diff --git a/pkg/controller/acmeorders/sync.go b/pkg/controller/acmeorders/sync.go index 6cde88af7..57fa872bd 100644 --- a/pkg/controller/acmeorders/sync.go +++ b/pkg/controller/acmeorders/sync.go @@ -161,6 +161,14 @@ func (c *controller) Sync(ctx context.Context, o *cmacme.Order) (err error) { return c.finalizeOrder(ctx, cl, o, genericIssuer) } + // At this point, if no Challenges have failed or reached a final state, + // we can return without taking any action. This controller will resync + // the Order on any owned Challenge events. + if !anyChallengesFailed(challenges) && !allChallengesFinal(challenges) { + log.V(logf.DebugLevel).Info("No action taken") + return nil + } + // Note: each of the following code paths uses the ACME Order retrieved // here. Be mindful when adding new code below this call to ACME server- // if the new code does not need this ACME order, try to place it above diff --git a/pkg/controller/acmeorders/sync_test.go b/pkg/controller/acmeorders/sync_test.go index a04fe2521..7866c7201 100644 --- a/pkg/controller/acmeorders/sync_test.go +++ b/pkg/controller/acmeorders/sync_test.go @@ -490,9 +490,6 @@ rUCGwbCUDI0mxadJ3Bz4WxR6fyNpBK2yAinWEsikxqEt ExpectedActions: []testpkg.Action{}, }, acmeClient: &acmecl.FakeACME{ - FakeGetOrder: func(_ context.Context, url string) (*acmeapi.Order, error) { - return testACMEOrderPending, nil - }, FakeHTTP01ChallengeResponse: func(s string) (string, error) { // TODO: assert s = "token" return "key", nil