agents/bundles: reactors must read metadata or be defaults
The left4me bundle's first cut had two reactors that returned static dicts without calling metadata.get(...): systemd_services (enable/run flags) and nftables_output (two static rule strings). Both passed bw test (no consumer yet). Once attached to ovh.left4me, bw raised "did not request any metadata, you might want to use defaults instead". Fix was to fold both into defaults. Document the pitfall, with the verbatim error wording and the note that this applies to cross-namespace contributions too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d3068ba8f6
commit
59788f315a
1 changed files with 8 additions and 0 deletions
|
|
@ -110,6 +110,14 @@ bundles/<name>/
|
||||||
itself; grep `'<other-bundle>':` in the reactors when in doubt.
|
itself; grep `'<other-bundle>':` in the reactors when in doubt.
|
||||||
- **`bw hash` doesn't accept selectors.** Use `bw hash <node>` per
|
- **`bw hash` doesn't accept selectors.** Use `bw hash <node>` per
|
||||||
literal name; see the fork's runbook.
|
literal name; see the fork's runbook.
|
||||||
|
- **Reactors must read metadata.** If a reactor body returns a static
|
||||||
|
dict without calling `metadata.get(...)`, bw raises
|
||||||
|
`ValueError: <reactor> on <node> did not request any metadata, you
|
||||||
|
might want to use defaults instead` once a node consumes the bundle.
|
||||||
|
Fix: fold the contribution into `defaults`. The rule applies even
|
||||||
|
when the reactor writes into another bundle's namespace — a static
|
||||||
|
contribution to e.g. `nftables/output` belongs in `defaults`, where
|
||||||
|
bw merges it with other bundles' contributions.
|
||||||
|
|
||||||
## Per-bundle README
|
## Per-bundle README
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue