Skip to content

Commit 61ef2a8

Browse files
committed
Tentative fix for rule precedence determinism
1 parent 49132e8 commit 61ef2a8

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/gateway/routeutils/route_rule_precedence.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,11 @@ func getHostnameListPrecedenceOrder(hostnameListOne, hostnameListTwo []string) i
183183
return precedence
184184
}
185185
}
186-
// can not complete tie breaking at hostname level
186+
if len(hostnameListOne) < len(hostnameListTwo) {
187+
return -1
188+
} else if len(hostnameListOne) > len(hostnameListTwo) {
189+
return 1
190+
}
187191
return 0
188192
}
189193

0 commit comments

Comments
 (0)