Commit 4795d04
authored
fix(ci): stop the layer-cache prune from being able to fail a build (#7252)
The settle loop added in 4f65103 reads `cur="$(total)"`, and composite steps
run under `bash -e -o pipefail`, where an assignment takes its command
substitution's exit status. So any failing `buildctl du` aborts the step and
fails the build. `echo "$(total)"` survives the same failure, which is why this
was invisible in the paths that ran first.
That is not hypothetical. Deleting a sticky disk out from under a running job
makes buildkitd panic inside cache.(*cacheManager).DiskUsage, and it took a
Build AMD64 job down that way. `grep` also exits 1 whenever du prints no Total
line, so an empty cache would have done it too.
A cache-hygiene step must never be able to fail a deploy, so `total()` now always
returns 0. The prune's own failure was already handled — it is an `if` condition,
and a failing condition does not trip `-e`.1 parent 4f65103 commit 4795d04
1 file changed
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
124 | 133 | | |
125 | 134 | | |
| |||
0 commit comments