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 setting the merged service to servicesByHostname #50691
Fix setting the merged service to servicesByHostname #50691
Conversation
For #50478 |
a938a07
to
033843a
Compare
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.
Thanks for fixing this. The original issue described the bug in terms of incorrectly configured endpoints; can we add a test that checks that specifically?
- 50478 | ||
releaseNotes: | ||
- | | ||
**Fixed** merge services ports should also compare the port name besides port number, otherwise the the ClusterLoadAssignments could be messed. |
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.
**Fixed** merge services ports should also compare the port name besides port number, otherwise the the ClusterLoadAssignments could be messed. | |
**Fixed** merge services ports should also compare the port name besides port number, otherwise the the ClusterLoadAssignments could be incorrect. |
@@ -980,7 +981,7 @@ func (sc *SidecarScope) appendSidecarServices(servicesAdded map[host.Name]sideca | |||
// Update index as well, so that future reads will merge into the new service | |||
foundSvc.svc = copied | |||
servicesAdded[foundSvc.svc.Hostname] = foundSvc | |||
sc.servicesByHostname[s.Hostname] = s | |||
sc.servicesByHostname[s.Hostname] = copied |
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 seems really subtle; should we add a comment?
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.
Added a test to gurantee. Yes, actually copied
is the merged Service
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.
Could you add a note to the description with what the configured clusters looked like before and after this change?
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.
I am not sure I agree the new behavior is desired. I opened an alternative in #50711. This brings us back to 1.19 behavior. LMK what you think.
Yes , i agree behavior below is right
|
It is very tricky for ServiceEntry to aligh with K8s service semantics. For that both portName and number can not be same |
033843a
to
fbbb92a
Compare
left some fix to #50711, only keep fixing servicesByHostname |
In response to a cherrypick label: #50691 failed to apply on top of branch "release-1.20":
|
In response to a cherrypick label: new issue created for failed cherrypick: #50729 |
In response to a cherrypick label: #50691 failed to apply on top of branch "release-1.21":
|
In response to a cherrypick label: new issue created for failed cherrypick: #50730 |
In response to a cherrypick label: new pull request created: #50731 |
Please provide a description of this PR:
During merge should: