-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Enhanced support for associating NICs with Load Balancers #1101
Conversation
Can one of the admins verify this patch? |
} | ||
} | ||
|
||
return null; |
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.
We should return this
here right? otherwise null ptr exception while running the next stage wither?
same with withExistingLoadBalancerInboundNatRule
as well.
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.
null is returned because the user cannot proceed here - the user is pointing at a Backend that does not exist, so the logic should fail fast here.
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.
...so to make their error checking robust, the user code should fist ensure that the backend exists:
if (!lb.backends().contains(backendName)) {
// Missing backend
} else {
// Call the code in question
}
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.
ah ok. I do have similar situation in VMSS, there i just throw ArgumentException
with a message so that user knows whats wrong, returning null seems fine.
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.
the reason I figured returning null would be ok in scenarios involving the passing of a child's name as an argument is because it seems equivalent to trying to access LoadBalancer.backends().get(backendName)
and similar child access scenarios, where children are returned as a Map
. The Map doesn't throw in the case of a bad name.
remerging - for some reason it's still showing up as open...
remerging - for some reason it's still showing up as open...
Backend: simple usage to associate an existing NIC (primary IP config) with an existing LB backend:
same idea for NIC definition.
NAT rule: