mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-11-18 03:21:05 +01:00
fix(nsc): properly check hairpinning rule
Previously, we would iterate over rulesFromNode, but then check it against the entirety of the rulesNeeded hash. This resulted in the loop breaking as soon as it found any matching rule from the host rather than it breaking if it matched the rule that we were currently processing.
This commit is contained in:
parent
146786ad8a
commit
2ca39f14f8
@ -1423,11 +1423,11 @@ func (nsc *NetworkServicesController) syncHairpinIptablesRules() error {
|
||||
}
|
||||
|
||||
// Apply the rules we need
|
||||
for _, ruleArgs := range rulesNeeded {
|
||||
for rule, ruleArgs := range rulesNeeded {
|
||||
ruleExists := false
|
||||
for _, ruleFromNode := range rulesFromNode {
|
||||
_, ruleExists = rulesNeeded[ruleFromNode]
|
||||
if ruleExists {
|
||||
if rule == ruleFromNode {
|
||||
ruleExists = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user