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

Fix GlobalPools determination of in use IPs #99

Merged

Conversation

tylerschultz
Copy link
Contributor

The namespace of a Global pool is empty string. This commit changes the namespace parameter of the lookup for in use IPs to use the pool namespace instead of the claim namespace.

In the case of InClusterIPPools the pool namespace matches the claim namespace. This namespace paramter is supplied to the in use IP lookup, and remains effectively the same.

In the case of GlobalInClusterIPPools, using the pool namespace will result in an empty namespace string. This empty namespace string will be used to find in use IPs. The empty string causes the lookup to find addresses in all namespaces, which is needed in the case of a global pool.

This commit addresses: #98

Fixes #98

The namespace of a Global pool is empty string. This commit changes the
namespace parameter of the lookup for in use IPs to use the pool
namespace instead of the claim namespace.

In the case of InClusterIPPools the pool namespace matches the claim
namespace. This namespace paramter is supplied to the in use IP lookup,
and remains effectively the same.

In the case of GlobalInClusterIPPools, using the pool namespace will
result in an empty namespace string. This empty namespace string will be
used to find in use IPs. The empty string causes the lookup to find
addresses in all namespaces, which is needed in the case of a global
pool.

This commit addresses: kubernetes-sigs#98

Signed-off-by: Tyler Schultz <[email protected]>
Co-authored-by: Edwin Xie <[email protected]>
@tylerschultz tylerschultz requested a review from schrej as a code owner March 27, 2023 18:08
Copy link
Member

@schrej schrej left a comment

Choose a reason for hiding this comment

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

Thanks!

@schrej schrej merged commit 0f0a391 into kubernetes-sigs:main Mar 29, 2023
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.

Global Pools should not give out duplicate IPs across namespaces
2 participants