-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 a segfault with cidr addresses and correct the creation of cluster network object #17076
fix a segfault with cidr addresses and correct the creation of cluster network object #17076
Conversation
…nfo when the address is not in cannonical form before this change when appeneding to the ClusterNetwork array if the cidr address is not in cannonical form the append happens outside the relevent scope and nil is appened, when a referance is made to the nil value the system segfaults.
…ct instead of the raw input from the master config file ParseNetworkInfo() will convert a given cidr address passed from the config file and transfrom it into canonical form. Use the converted cidr address returned from ParseNetworkInfo() to create the ClusterNetwork object.
/kind bug |
/test |
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, thanks @JacobTanenbaum
var parsedClusterNetworkEntries []networkapi.ClusterNetworkEntry | ||
for _, entry := range master.networkInfo.ClusterNetworks { | ||
parsedClusterNetworkEntries = append(parsedClusterNetworkEntries, networkapi.ClusterNetworkEntry{CIDR: entry.ClusterCIDR.String(), HostSubnetLength: entry.HostSubnetLength}) | ||
} |
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.
Another reason for converting master.networkInfo.ClusterNetworks to []networkapi.ClusterNetworkEntry
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JacobTanenbaum, pravisankar The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/retest |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
Automatic merge from submit-queue. |
Automatic merge from submit-queue. Fix crash with invalid serviceNetworkCIDR #17076 fixed the corresponding crash with clusterNetworkCIDR, but serviceNetworkCIDR had the same problem. Also, this slightly simplifies the previous fix.
Currently the system segfaults if passed a cidr that is not in canonical form, this was due to scoping issues in ParseNetworkInfo().
Also fix the creation of the clusterNetworkObject to use the converted form of the cidr address when creating the clusterNetwork object to conform to how the system used to function
@knobunc PTAL
found while working on
Bug: 1506017