Fix Kingfisher CronJob exit code handling

Kingfisher exits 200 (findings) or 205 (validated findings) on success.
Normalize these to 0 so the CronJob completes instead of restarting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-03-30 07:16:02 -07:00
commit b000efd6c3

View file

@ -26,6 +26,9 @@ spec:
OUTDIR=/reports/kingfisher
mkdir -p "$OUTDIR"
# Exit codes: 0=clean, 200=findings, 205=validated findings.
# All are successful scans; only other codes are real errors.
rc=0
kingfisher scan gitea \
--api-url https://forge.ops.eblu.me/api/v1/ \
--clone-url-base https://forge.ops.eblu.me/ \
@ -35,7 +38,13 @@ spec:
--tls-mode lax \
--allow-internal-ips \
--format html \
--output "$OUTDIR/scan-${STAMP}.html"
--output "$OUTDIR/scan-${STAMP}.html" \
|| rc=$?
if [ "$rc" -eq 0 ] || [ "$rc" -eq 200 ] || [ "$rc" -eq 205 ]; then
exit 0
fi
exit "$rc"
env:
- name: KF_GITEA_TOKEN
valueFrom: