@rcpooley/concord-kit 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/assemble.js +9 -3
  2. package/package.json +1 -1
package/dist/assemble.js CHANGED
@@ -304,9 +304,15 @@ function validate(all, fleet) {
304
304
  seenEdge.set(key, a.name);
305
305
  }
306
306
  }
307
- for (const [host, m] of Object.entries(fleet)) {
308
- if (m.sleeps && m.edge) {
309
- throw new Error(`hosts: ${host} sleeps and declares an edge — an ingress cannot sleep`);
307
+ // A sleeping machine may run an edge, but only for its own apps. When it is
308
+ // asleep its routes are down along with the apps behind them, which is no
309
+ // worse than the apps being down. Fronting ANOTHER machine's app would make
310
+ // that app's reachability depend on a lid, so that stays an error.
311
+ for (const a of all) {
312
+ const edgeHost = a.servedBy ?? a.host;
313
+ if (edgeHost !== a.host && fleet[edgeHost]?.sleeps) {
314
+ throw new Error(`apps: "${a.name}" runs on ${a.host} but is served by ${edgeHost}, which sleeps — ` +
315
+ `a sleeping machine's edge may serve only its own apps`);
310
316
  }
311
317
  }
312
318
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rcpooley/concord-kit",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "description": "Opinionated building blocks for a Concord config repo: apps as one file each, machines that derive their base layers, an nginx edge with derived certificate coverage, and assemble() to put the modules in order.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/rcpooley/concord/tree/main/kit",