-
Notifications
You must be signed in to change notification settings - Fork 359
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
Enhance ExternalIPPool validation #5898
Conversation
I initially planned to use Line 231 in ba57a7f
|
cc @tnqn |
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.
The 3rd item of the issue originally means "All IPRanges of ExternalIPPools must not overlap", not only IP ranges of a single ExternalIPPool, because the datapath wouldn't be working if it's configured so. I guess it's hard to strictly prevent it because externalIPPoolLister may be not in sync with actual objects in kube-apiserver, but it should be able to prevent most configuration errors and still better than not checking at all, so could you also checking overlap with ranges in ExternalIPPoolController.externalIPPoolLister
?
ef42754
to
5cf246f
Compare
8e2f678
to
388639a
Compare
ad31ed5
to
f5da8d2
Compare
f5da8d2
to
78a279d
Compare
3 e2e tests failed at TestEgress. There seemed to be a panic when calling the changed webhook: |
Presently, when validating ExternalIPPool, attempting to invoke methods defined on externalIPPoolController results in a nil pointer exception and eventually triggers a panic. With this commit, the initialized externalIPPoolController is used to construct the APIServer configuration,facilitating access to other methods of externalIPPoolController during the validation of ExternalIPPool. Signed-off-by: Daman Arora <aroradaman@gmail.com>
Signed-off-by: Daman Arora <aroradaman@gmail.com>
It was because antrea/pkg/apiserver/apiserver.go Line 330 in 025c3f6
|
yeah, figured that. I was just about to push the commit fixing that. |
78a279d
to
65e5b3f
Compare
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.
LGTM, thanks @aroradaman
/skip-all |
/test-ipv6-e2e |
@aroradaman e2e test failed when it tried to update an externalIPPool. The |
I added a unit test to update Assuming an update from |
That's another story and may require more changes in ip allocators as well. It's better to focus on the 3 validations in this PR. |
* Validate if any IPRange don't overlap with another IPRange of current or existing pool * Validate if IPRange.Start <= IPRange.End * Validate if IPRange.Start and IPRange.End belong to same IP family Signed-off-by: Daman Arora <aroradaman@gmail.com>
65e5b3f
to
8e7ca2d
Compare
/test-ipv6-e2e |
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.
LGTM
/skip-all |
Fixes: #5842