-
Notifications
You must be signed in to change notification settings - Fork 689
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 for specifying a health check port with an ExternalName Service #6230
Conversation
Signed-off-by: yangyang <yang.yang@daocloud.io>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6230 +/- ##
=======================================
Coverage 81.33% 81.33%
=======================================
Files 133 133
Lines 15772 15775 +3
=======================================
+ Hits 12828 12831 +3
Misses 2650 2650
Partials 294 294
|
xds.ClusterLoadAssignmentName( | ||
types.NamespacedName{Name: service.Weighted.ServiceName, Namespace: service.Weighted.ServiceNamespace}, | ||
service.Weighted.ServicePort.Name, | ||
), | ||
SocketAddress(service.ExternalName, int(service.Weighted.ServicePort.Port)), | ||
) | ||
if service.Weighted.ServicePort.Port != service.Weighted.HealthPort.Port { | ||
cla.Endpoints[0].LbEndpoints[0].GetEndpoint().HealthCheckConfig = HealthCheckConfig(service.Weighted.HealthPort.Port) |
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 OK to me but I had to stop for a bit when reading - we know we always assign exactly 1 address and therefore it is safe to access Endpoints[0].LbEndpoints[0]
, right?
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.
yeah we pass only one address to ClusterLoadAssignment
above so the returned cla
should have one endpoint entry, but lets add another test of just the ExternalNameClusterLoadAssignment
function to endpoint_test.go
to be sure
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.
looks good just needs another test and changelog file
Signed-off-by: yangyang <yang.yang@daocloud.io>
Signed-off-by: yangyang <yang.yang@daocloud.io>
…rojectcontour#6230) Signed-off-by: yangyang <yang.yang@daocloud.io>
close #6229