-
Notifications
You must be signed in to change notification settings - Fork 39.3k
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 an issue in NodeInfo.Clone() #67456
fix an issue in NodeInfo.Clone() #67456
Conversation
- usedPorts is a map-in-map struct, add fix to ensure it's deep copied - updated unit test
/sig scheduling |
/ok-to-test |
/LGTM |
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.
Great that you caught this issue, @Huang-Wei! Thanks!
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, duglin, Huang-Wei The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This should be cherrypicked to previous releases. |
Thanks @bsalamat . I will create cherrypick PRs once this one get merged. |
/test pull-kubernetes-integration |
/retest |
LGTM :) |
Automatic merge from submit-queue (batch tested with PRs 65561, 67109, 67450, 67456, 67402). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Due to PR "Refactor HostIP predicate algorithm #55910", internal
usedPorts
data structure was changed from "map[string]bool" to "map[string]map[ProtocolPort]struct{}".However, it breaks behavior of
NodeInfo.Clone()
: in the before, one loopfor k, v := range usedPorts
worked fine because it's a safe assignment, but it's not safe any more for a map-in-map using original code. A similar go playground sample is here: https://play.golang.org/p/puqMN71cmSO.Which issue(s) this PR fixes:
Fixes #67453 (Might also related with #66568)
Special notes for your reviewer:
Release note: