Refuse a port given for the whole mesh where it is set, not at every node's composition (hq ADR 0100)

This commit is contained in:
2026-09-22 19:45:35 +02:00
parent 0f3eedd163
commit 87ecc9326e
3 changed files with 44 additions and 5 deletions
+11
View File
@@ -585,6 +585,17 @@ func (i *Inventory) SetSettings(ctx context.Context, nodeName, module string, va
return err
}
if nodeName == "" {
// A port is a fact about one machine (novox/hq ADR 0100). Refused here, in composition's
// words: stored, it refuses every node running the module at composition, and the mesh
// cannot be pushed at all until somebody finds the layer that did it.
given, err := givenIn(module, raw)
if err != nil {
return err
}
if len(given) > 0 {
return fmt.Errorf("%s: %s is given per node — a port is a fact about one machine; "+
"set it with --node", module, catalogue.PortsSetting)
}
_, err = i.store.Pool().Exec(ctx,
`insert into settings (node, module, values) values (null, $1, $2)
on conflict (module) where node is null