| index ea43a8736..939bc03cc 100644 |
| --- a/internal/provision/reconcile_rootfs_backstop_test.go |
| +++ b/internal/provision/reconcile_rootfs_backstop_test.go |
| @@ -63,7 +63,8 @@ func strippedRecord(sqid, host string) Record { |
| |
| // [Whole-branch review P1-2] The box's backstop: a record with no runtime |
| // for an app whose kind marker says rootfs is never minted as a binary row. |
| -// It is left unmaterialized and logged, pass after pass. A binary app's |
| +// It is left unmaterialized and logged, pass after pass, while the app's |
| +// static and upstream-backed records mint as before. A binary app's |
| // record, or one of an app with no marker, mints as before. The marker is |
| // read once per app per pass and only for a record with no row yet; a |
| // read that fails defers the mint. |
| @@ -73,7 +74,11 @@ func TestReconcileRefusesABinaryRowForARootfsApp(t *testing.T) { |
| d, sqid := rootfsSetup(t) |
| s := &kindMarkerStore{DirStore: d} |
| putKindMarker(t, s, sqid, release.KindRootfs) |
| - for _, rec := range []Record{strippedRecord(sqid, a), strippedRecord(sqid, b), rootfsRecord(sqid, c, false)} { |
| + static := strippedRecord(sqid, "static.shop.example.com") |
| + static.Kind = "static" |
| + upstream := strippedRecord(sqid, "api.shop.example.com") |
| + upstream.Addrs = []string{"127.0.0.1:9000"} |
| + for _, rec := range []Record{strippedRecord(sqid, a), strippedRecord(sqid, b), rootfsRecord(sqid, c, false), static, upstream} { |
| if err := CreateRecord(ctx, s, rec); err != nil { |
| t.Fatal(err) |
| } |
| @@ -94,6 +99,13 @@ func TestReconcileRefusesABinaryRowForARootfsApp(t *testing.T) { |
| if got := mustGet(t, reg, c); got.Runtime != registry.RuntimeRootfsV1 { |
| t.Fatalf("pass %d: the rootfs record's row = %+v", pass, got) |
| } |
| + // A static or upstream-backed record of a rootfs app starts no |
| + // process and carries no runtime by design: minted as before. |
| + for _, host := range []string{static.Host, upstream.Host} { |
| + if got := mustGet(t, reg, host); got.Runtime != "" { |
| + t.Fatalf("pass %d: %s minted %+v, want a plain row", pass, host, got) |
| + } |
| + } |
| if n := s.markerGets(); n != 1 { |
| t.Fatalf("pass %d: %d marker reads, want 1 (once per app per pass)", pass, n) |
| } |