-
Notifications
You must be signed in to change notification settings - Fork 62
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
Filter NodeBalancers when we know their ipv4 #126
Conversation
I see the LinodeGo update PR: #118 |
The original plan was to do these two things together (and PR 118 had these two changes baked in), but then we found out the v1 update will cause an issue wrt env variables - we can't use our current So in order to expedite this server-side filter, we decided to split the work in two. |
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.
This looks pretty good. I ran the e2e tests and they all passed. I have a few minor comments.
// return nil, err | ||
// } | ||
filter := fmt.Sprintf(`{"ipv4": "%v"}`, ipv4) | ||
lbs, err := l.client.ListNodeBalancers(ctx, &linodego.ListOptions{Filter: filter}) | ||
if err != nil { | ||
return nil, err | ||
} |
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.
It seems the loop below this may no longer be needed if we are getting the exact ip. Or it could be adjusted to be cleaner. Although leaving it how it is I don't think will harm anything.
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.
Good point. Did you have something like this in mind?
if len(lbs) == 0 {
return nil, lbNotFoundError{serviceNn: getServiceNn(service)}
}
klog.V(2).Infof("found NodeBalancer (%d) for service (%s) via IPv4 (%s)", lbs[0].ID, getServiceNn(service), ipv4)
return &lbs[0], nil
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.
yes I like that
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.
Committed.
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
General:
Pull Request Guidelines: