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

Verify LB ip and address pool annotations compatibility #1920

Merged
merged 1 commit into from May 3, 2023

Conversation

mlguerrero12
Copy link
Contributor

When a service requests a specific LB IP(s) and address pool via annotations, these must be compatible.

Fixes #1916

.gitignore Outdated Show resolved Hide resolved
// Verify that ip and address pool annotations are compatible.
if desiredPool != "" && c.ips.Pool(key) != desiredPool {
c.ips.Unassign(key)
return nil, fmt.Errorf("requested loadBalancer IP(s) %q is not compatible with requested address pool %s", desiredLbIPs, desiredPool)
Copy link
Member

Choose a reason for hiding this comment

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

we might want to return a custom error we handle outside here. Specifically, when this happens it makes sense to clear the service. We might get here with a user adding the annotation after the lb ip. In that case we need to wipe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the service is cleared here. your example is handled in line 107

Copy link
Member

Choose a reason for hiding this comment

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

Makes sense.
I thought assign would set the ips on the svc.

When a service requests a specific LB IP(s) and address pool via
annotations, these must be compatible.

Fixes metallb#1916

Signed-off-by: Marcelo Guerrero Viveros <marguerr@redhat.com>
@fedepaol
Copy link
Member

fedepaol commented May 3, 2023

lgtm

@fedepaol fedepaol enabled auto-merge May 3, 2023 13:50
@fedepaol fedepaol added this pull request to the merge queue May 3, 2023
Merged via the queue into metallb:main with commit 0403dda May 3, 2023
24 checks passed
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.

opposite loadBalancerIPs and address-pool annotations on a service
2 participants