fix(cdn): resolve a pull zone when the API answers with a bare array #178
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/purge-zone-lookup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Motivation
Every reindex reports
failureat the purge step:cran.rpkgs.compurges fine. The Alliance zone never has, so it is still serving objects that rebuilds replaced, behind a ~370-daycache_expiration_time.The defect
This was meant to accept both response shapes. It accepts neither: indexing an array with a string is an error in jq, not a null, so
//never gets the chance to substitute and the whole expression aborts. The listing endpoint answers with a bare array for this account, so the lookup has always failed.Change
//to absorb an error.perPage=1000, so a paginated response cannot silently truncate the zone list.Verification
Ran the current
mainscript and the fixed one against a stubbedcurlreturning an array-shaped listing:The jq expression was also checked against both an array-shaped and an object-shaped (
.Items) response; the old one fails the array case, the new one handles both.shellcheckclean.