fix a segfault with cidr addresses and correct the creation of cluster network object #17076
Merged
openshift-merge-robot merged 2 commits intoopenshift:masterfrom Oct 29, 2017
Merged
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.
Contributor
|
/kind bug |
Contributor
|
/test |
knobunc
approved these changes
Oct 27, 2017
Contributor
knobunc
left a comment
There was a problem hiding this comment.
LGTM, thanks @JacobTanenbaum
pravisankar
reviewed
Oct 27, 2017
| 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.
Another reason for converting master.networkInfo.ClusterNetworks to []networkapi.ClusterNetworkEntry
pravisankar
approved these changes
Oct 27, 2017
|
/lgtm |
Contributor
|
[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. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
/retest |
Contributor
|
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
Contributor
|
/retest Please review the full test history for this PR and help us cut down flakes. |
Contributor
|
Automatic merge from submit-queue. |
openshift-merge-robot
added a commit
that referenced
this pull request
Nov 1, 2017
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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