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
+7 -5
View File
@@ -214,17 +214,19 @@ func TestConsumersAreToldTheGivenPort(t *testing.T) {
}
}
// A port for the whole mesh is refused where it is set, not stored to refuse every node's
// declaration afterwards.
if err := open.inventory.SetSettings(ctx, "", "store",
map[string]any{catalogue.PortsSetting: map[string]any{"5432": 5434}}); err != nil {
t.Fatal(err)
map[string]any{catalogue.PortsSetting: map[string]any{"5432": 5434}}); err == nil ||
!strings.Contains(err.Error(), "per node") {
t.Fatalf("a port given for the whole mesh was not refused: %v", err)
}
plan, settings, err := planFor(ctx, open, "anchor")
if err != nil {
t.Fatal(err)
}
if _, err := declarationFor(ctx, open, "anchor", plan, settings); err == nil ||
!strings.Contains(err.Error(), "per node") {
t.Fatalf("a port given for the whole mesh was not refused: %v", err)
if _, err := declarationFor(ctx, open, "anchor", plan, settings); err != nil {
t.Fatalf("the refused mesh-wide layer was stored anyway: %v", err)
}
}