diff --git a/renewal/find-next-cert.sql b/renewal/find-next-cert.sql index ec8f99d..6f719b8 100644 --- a/renewal/find-next-cert.sql +++ b/renewal/find-next-cert.sql @@ -1,6 +1,6 @@ -select cert.id, cert.not_after, dns.type, dns.token, cert.temp_parent +select cert.id, cert.not_after, dns_acme.type, dns_acme.token, cert.temp_parent from certificates as cert - left outer join dns on cert.dns = dns.id + left outer join dns_acme on cert.dns = dns_acme.id where cert.active = 1 and (cert.auto_renew = 1 or cert.not_after IS NULL) and cert.renewing = 0 diff --git a/renewal/service_test.go b/renewal/service_test.go index b7764d7..94619b3 100644 --- a/renewal/service_test.go +++ b/renewal/service_test.go @@ -25,6 +25,7 @@ import ( "os" "os/exec" "path/filepath" + "sort" "sync" "testing" "time" @@ -194,6 +195,8 @@ func TestPebbleRenewal(t *testing.T) { assert.Equal(t, "CERTIFICATE", p.Type) outCert, err := x509.ParseCertificate(p.Bytes) assert.NoError(t, err) + sort.Strings(i.domains) + sort.Strings(outCert.DNSNames) assert.Equal(t, i.domains, outCert.DNSNames) }) }