Merge pull request #1197 from munnerz/acme-retain-challenges

Retain Challenge resources for debugging if an Order enters an invalid state
This commit is contained in:
jetstack-bot 2019-01-11 17:22:11 +00:00 committed by GitHub
commit 2fc68d9b33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,13 @@ func (c *Controller) Sync(ctx context.Context, o *cmapi.Order) (err error) {
return err
}
// Don't cleanup challenge resources if the order has failed.
// This will make it easier for users to debug failing challenges.
// The challenge resources will be cleaned up when the Order is deleted.
if acme.IsFailureState(o.Status.State) {
return nil
}
// Cleanup challenge resources once a final state has been reached
for _, ch := range existingChallenges {
err := c.CMClient.CertmanagerV1alpha1().Challenges(ch.Namespace).Delete(ch.Name, nil)