Skip to content

Verify LB ip and address pool annotations compatibility#1920

Merged
fedepaol merged 1 commit intometallb:mainfrom
mlguerrero12:compatibleannotations
May 3, 2023
Merged

Verify LB ip and address pool annotations compatibility#1920
fedepaol merged 1 commit intometallb:mainfrom
mlguerrero12:compatibleannotations

Conversation

@mlguerrero12
Copy link

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

Fixes #1916

// 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
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.

@mlguerrero12 mlguerrero12 force-pushed the compatibleannotations branch from 41269f0 to a0a0aa1 Compare May 3, 2023 13:39
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>
@mlguerrero12 mlguerrero12 force-pushed the compatibleannotations branch from a0a0aa1 to fa3184f Compare May 3, 2023 13:39
@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
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