Skip to content

fix(catalog): Validate() no longer flags a private image bound in a local overlay - #38

Merged
scttfrdmn merged 1 commit into
mainfrom
fix/catalog-validate-overlay-leak
Aug 7, 2026
Merged

fix(catalog): Validate() no longer flags a private image bound in a local overlay#38
scttfrdmn merged 1 commit into
mainfrom
fix/catalog-validate-overlay-leak

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

  • catalog.Validate()'s public-image check (#392) ran against List() — the embedded catalog merged with a user's local overlay — so any machine with a ~/.spawn/catalog.yaml rebinding an app to a private ECR image (the overlay's entire purpose) failed Validate() as if the shipped catalog itself were broken.
  • Reproduced with a real overlay on this machine (paraview/chimerax rebound to a private registry) and confirmed it's what broke spawn#489's TestCatalogValid, which calls catalog.Validate() directly.
  • Fix: the public-image check now runs against a new embeddedApps() (parses catalog.yaml directly, no overlay merge), not List().

Fixes spawn#489.

Test plan

  • New TestValidate_IgnoresOverlayPrivateImage reproduces the exact failure via the existing withOverlay test helper — confirmed it FAILS without the fix (sed'd the fix out, re-ran, restored) and PASSES with it
  • go test ./... — full suite green, no existing test changed behavior
  • go build ./..., go vet ./..., gofmt -l clean
  • golangci-lint run ./catalog/... — 6 pre-existing issues in untouched files (main_test.go, resolve.go, resolve_test.go), confirmed identical with this change stashed out

…ocal overlay

Validate() checked List() (embedded + overlay merged) for the
shipped-catalog-must-be-public rule (#392), so a machine with a
~/.spawn/catalog.yaml rebinding an app to a private ECR image — the
overlay's whole purpose — failed as if the SHIPPED catalog were
broken. Only the local (correctly private) overlay binding was
private; the embedded catalog.yaml was fine.

This broke `go test`/`make check` for any contributor with such an
overlay, and spawn's TestCatalogValid calls Validate() directly, so it
broke spawn's CI-equivalent too (spawn#489) — confirmed via a real
~/.spawn/catalog.yaml on this machine binding paraview/chimerax to a
private registry.

The public-image check now runs against the embedded catalog.yaml only
(new embeddedApps() helper), not the overlay-merged List(). Added a
regression test that reproduces the exact failure via withOverlay,
verified it fails without the fix and passes with it.

Fixes spawn#489.
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
catalog/catalog.go 60.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit b2e6c6e into main Aug 7, 2026
5 of 6 checks passed
@scttfrdmn
scttfrdmn deleted the fix/catalog-validate-overlay-leak branch August 7, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant