Fix a bug when a namespace has two egress IPs on same node #19926
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#19603 was supposed to make us sanity-check-but-ignore additional egress IPs on a namespace, but it accidentally made it so that the iptables rules for the IP would get set up anyway. In the sane case where the namespace had multiple egress IPs on different nodes, this had no visible effect, because no one was sending egress traffic for the namespace to the second node anyway, so it just had a useless iptables rule. But if you had two egress IPs for the same namespace on the same node (which is stupid, but...) then they'd both get set up on that node, and the second one ended up having priority over the first one.
This fixes it so that only the first egress IP for a namespace ever gets set up. (#19578 will need a larger fix.)
The change to
updateNamespaceEgress
is to deal with:["1.1.1.1", "2.2.2.2"]
["1.1.1.1"]
(which will add OVS and iptables rules for1.1.1.1
)["2.2.2.2", "1.1.1.1"]
(which needs to add OVS and iptables rules for2.2.2.2
and remove them for1.1.1.1
, but in order to make the latter happen, we have to add1.1.1.1
to the "changed" list, even though it didn't actually change)Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1585947