mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-08-15 07:40:59 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user