Skip to content
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

Add support for IP ranges exclusion for IPPool CRD #46

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

ykulazhenkov
Copy link
Collaborator

Depends on #44

Last commit to review.

This change is required to support "static IP" use-case with IPPool pools

Copy link
Collaborator

@vasrem vasrem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

for _, alloc := range ipPool.Status.Allocations {
if alloc.NodeName == r.NodeName {
exclusions := make([]pool.ExclusionRange, 0, len(ipPool.Spec.Exclusions))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we don't need additional logic here. The node's allocator implementation will reject configurations where exclusions are outside of the node's subnet. In the case of IPPool, all nodes use the same subnet, so any exclusions that match the pool's subnet are valid for all nodes. However, with CIDRPool, each node has a unique subnet, so we need to filter the pool's exclusions and only pass valid exclusions to the node's allocator.

@coveralls
Copy link

Coverage Status

coverage: 68.645% (-1.4%) from 70.0%
when pulling 1575edd on ykulazhenkov:pr-ippool-excludes
into 9531cf5 on Mellanox:main.

Signed-off-by: Yury Kulazhenkov <ykulazhenkov@nvidia.com>
@coveralls
Copy link

Coverage Status

coverage: 68.645% (-0.09%) from 68.731%
when pulling 9a60011 on ykulazhenkov:pr-ippool-excludes
into 0df7f64 on Mellanox:main.

@ykulazhenkov ykulazhenkov merged commit 24b9875 into Mellanox:main Jun 13, 2024
9 checks passed
@ykulazhenkov ykulazhenkov deleted the pr-ippool-excludes branch June 13, 2024 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants