From c22d27ee9830bc6ed3152c1df526b47ef59e5315 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Tue, 26 May 2026 08:36:39 +0300 Subject: [PATCH] test.yml: collapse cache_garage_image to single 'cacher docker download --pull' Now that v0.1.1 (with --pull) is the published binary on pages, the if/else with exists/download/upload can fold into the one-line form. SilenceUsage in v0.1.1 also removes the cobra-dump-on-miss noise that required the stderr swallow on the previous `exists` check. --- .builds/test.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.builds/test.yml b/.builds/test.yml index 72971a819fa035e59548bd2be230b6cde32b9254..746c4cae9df58d85b484e81acb156573328843fd 100644 --- a/.builds/test.yml +++ b/.builds/test.yml @@ -10,10 +10,9 @@ # * The Go tarball, via `cacher download --url` fallback. # * ~/go/pkg/mod, keyed on sha256(go.sum) — biggest win, the docker # SDK transitives pulled in by testcontainers are heavy. -# * The Garage docker image, via `cacher docker {exists,download, -# upload}`. Switch to `cacher docker download --pull` after the -# next release; the single-command form lives on master but -# isn't in v0.1.0. +# * The Garage docker image, via `cacher docker download --pull` — +# single call that does cache HIT → docker load, or cache MISS → +# docker pull + seed. image: ubuntu/noble packages: - curl @@ -90,16 +89,8 @@ tasks: - cache_garage_image: | # Key derived from the image ref so a version bump invalidates # the cache automatically: dxflrs/garage:v2.3.0 → dxflrs-garage-v2.3.0 - # stderr swallowed on `exists` because v0.1.0 still dumps the - # cobra Usage block on a miss (SilenceUsage lands in the next - # release). KEY="docker/$(echo "$GARAGE_IMAGE" | tr '/:' '-').tar.zst" - if cacher docker exists "$KEY" >/dev/null 2>&1; then - cacher docker download "$KEY" "$GARAGE_IMAGE" - else - docker pull "$GARAGE_IMAGE" - cacher docker upload "$KEY" "$GARAGE_IMAGE" - fi + cacher docker download "$KEY" "$GARAGE_IMAGE" --pull docker images "$GARAGE_IMAGE" - test_e2e: | cd ci-cacher