-
Notifications
You must be signed in to change notification settings - Fork 3.4k
pkg/redirectpolicy: Fix backend slices in processConfig #35496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
252e9d9
to
3f45507
Compare
/test |
Commit 35c4bc4 does not match "(?m)^Signed-off-by:". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
Cilium E2E Upgrade (ci-e2e-upgrade) test failed, and I did a rebasing, shall we redo the testing? |
hi @Sm0ckingBird , thank you for the contribution! That does look like a bug indeed :). Could you please add some tests in Besides that, just one comment to polish the patch:
I believe you meant to say the above, correct? |
No problem :)
That's correct, thanks for pointing this out! |
@julianwiedmann tests added, without the fix, the following errors will be reported
Currently, I have the fix and the tests in one commit, do you prefer them in two separate commit? |
In each iteration of pod in function processConfigWithSinglePort and processConfigWithNamedPorts bes4 and bes6 need to be cleared. Otherwise, when size of pods is larger than one, aka when the iteration time is more than one, bes4 and bes6 will aggregate all of the backends. For example, in the first iteration backend 10.0.2.250:80 is added, then in the second iteration [10.0.2.250:80, 10.0.2.199:80] are added. 10.108.13.48:80 LocalRedirect 1 => 10.0.2.199:80 2 => 10.0.2.250:80 3 => 10.0.2.250:80 Fixes: e7bb8a7 ("k8s/cilium Event handlers and processing logic for LRPs") Signed-off-by: Zijian Zhang <zijianzhang@bytedance.com>
/test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, lgtm! Having it as a single commit is fine.
In each iteration of pod in function processConfigWithSinglePort and processConfigWithNamedPorts bes4 and bes6 need to be cleared. Otherwise, when size of pods is larger than one, aka when the iteration time is more than one, bes4 and bes6 will aggregate all of the backends.
For example, in the first iteration backend 10.0.2.250:80 is added, then in the second iteration [10.0.2.250:80, 10.0.2.199:80] are added.
Fixes: e7bb8a7 ("k8s/cilium Event handlers and processing logic for LRPs")