fix(node): adopt a matching deployed inbound instead of recreating it (#6197)

* fix(node): adopt compatible origin inbounds without mutation

* fix(nodes): preserve ambiguous and adopted aliases

---------

Co-authored-by: n0ctal <293235942+n0ctal@users.noreply.github.com>
This commit is contained in:
n0ctal
2026-08-14 23:01:35 +05:00
committed by GitHub
parent 3b19091547
commit bb29b6afec
7 changed files with 241 additions and 10 deletions
+15
View File
@@ -235,3 +235,18 @@ func TestFilterNodeSnapshotMatchesPrefixedSelectedTag(t *testing.T) {
t.Fatalf("bare selected tag in-100-tcp was dropped; kept=%v", kept)
}
}
func TestFilterNodeSnapshotKeepsAdoptedAlias(t *testing.T) {
snap := &runtime.TrafficSnapshot{
Inbounds: []*model.Inbound{{Tag: "deployed-alias"}, {Tag: "unmanaged"}},
ManagedAliases: []string{"deployed-alias"},
}
FilterNodeSnapshot(&model.Node{
InboundSyncMode: "selected",
InboundTags: []string{"desired-name"},
}, snap)
if len(snap.Inbounds) != 1 || snap.Inbounds[0].Tag != "deployed-alias" {
t.Fatalf("filtered snapshot = %#v, want adopted alias only", snap.Inbounds)
}
}