Skip to content

Commit 483d856

Browse files
lenaunderwood22mkhandker19
authored andcommitted
Don't exit on failure if cert-checker finds bad certs (#8866)
Cert-checker failing when it finds bad certs has undesirable behavior on the deploy side (e.g. job failure due to bad cert discovery leads to unnecessary redeployment of the job and re-firing of associated alerts) and IMO finding bad certs is not a failure of the cert-checker (in fact, it did it's job, woohoo!)
1 parent 4ca5cda commit 483d856

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

cmd/cert-checker/main.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,10 +756,6 @@ func main() {
756756
}
757757
}
758758
}
759-
760-
if checker.issuedReport.BadCerts > 0 {
761-
os.Exit(1)
762-
}
763759
}
764760

765761
func init() {

test/integration-test.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,18 @@ def check_balance():
140140
% address)
141141

142142
def run_cert_checker():
143-
run(["./bin/boulder", "cert-checker", "-config", "%s/cert-checker.json" % config_dir])
143+
# cert-checker no longer exits non-zero when it finds bad certs, so capture
144+
# its output and inspect the report it logs when it finishes.
145+
output = subprocess.check_output(
146+
["./bin/boulder", "cert-checker", "-config", "%s/cert-checker.json" % config_dir],
147+
stderr=subprocess.STDOUT).decode()
148+
print(output)
149+
150+
match = re.search(r'Finished processing certificates JSON=.*"bad-certs":(\d+)', output)
151+
if match is None:
152+
raise(Exception("cert-checker did not emit a final report"))
153+
if int(match.group(1)) > 0:
154+
raise(Exception("cert-checker found %s bad certs" % match.group(1)))
144155

145156
def process_covdata(coverage_dir):
146157
"""Process coverage data and generate reports."""

0 commit comments

Comments
 (0)