ci: smoke-containers must fail, not skip, when it cannot resolve an image #615

Stängd
öppnade 2026-10-08 21:12:23 +00:00 av supernaut · 0 kommentarer
Ägare

What

scripts/smoke-containers.py loads each Quadlet unit and checks its capabilities against the pinned image. resolve() only substitutes plain {{ var }} references (:57-69). caddy_runtime_image is a Jinja conditional (roles/caddy/defaults/main.yml:63-66). It resolves to None. main() treats None as internal and prints SKIP, exit 0 (:199-203).

Related to #103: moving values into group_vars/prod would hit the same silent skip, because load_vars only reads group_vars/all.

Why

The script exists to catch the #94 failure class (a capability or option the image cannot run with).

Failing case

Remove NET_BIND_SERVICE from roles/caddy/templates/caddy.container.j2. The smoke prints SKIP caddy ... unresolved image and CI passes.

Fix

Smoke the stock base image for Caddy ({{ caddy_image }}:{{ caddy_image_tag }}) through a small per-role override map. Make an unresolved image a FAIL. Only a literal localhost/ or git.bitborg.se/ prefix may skip.

Done when

  • Removing NET_BIND_SERVICE from the Caddy unit fails CI.
  • An unresolvable image is a failure unless it has an allowed internal prefix.
  • The override map is covered by a short test.
## What `scripts/smoke-containers.py` loads each Quadlet unit and checks its capabilities against the pinned image. `resolve()` only substitutes plain `{{ var }}` references (`:57-69`). `caddy_runtime_image` is a Jinja conditional (`roles/caddy/defaults/main.yml:63-66`). It resolves to None. `main()` treats None as internal and prints `SKIP`, exit 0 (`:199-203`). Related to #103: moving values into `group_vars/prod` would hit the same silent skip, because `load_vars` only reads `group_vars/all`. ## Why The script exists to catch the #94 failure class (a capability or option the image cannot run with). ## Failing case Remove `NET_BIND_SERVICE` from `roles/caddy/templates/caddy.container.j2`. The smoke prints `SKIP caddy ... unresolved image` and CI passes. ## Fix Smoke the stock base image for Caddy (`{{ caddy_image }}:{{ caddy_image_tag }}`) through a small per-role override map. Make an unresolved image a FAIL. Only a literal `localhost/` or `git.bitborg.se/` prefix may skip. ## Done when - [ ] Removing `NET_BIND_SERVICE` from the Caddy unit fails CI. - [ ] An unresolvable image is a failure unless it has an allowed internal prefix. - [ ] The override map is covered by a short test.
Logga in för att delta i denna konversation.
Ingen milstolpe
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-infra#615
Ingen beskrivning angiven.