Skip to content
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

Merged
merged 2 commits into from
Oct 29, 2017

Conversation

JacobTanenbaum
Copy link
Contributor

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

…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.
@openshift-ci-robot openshift-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 27, 2017
@knobunc
Copy link
Contributor

knobunc commented Oct 27, 2017

/kind bug

@openshift-ci-robot openshift-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Oct 27, 2017
@knobunc
Copy link
Contributor

knobunc commented Oct 27, 2017

/test

Copy link
Contributor

@knobunc knobunc left a 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})
}

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

@pravisankar
Copy link

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 27, 2017
@openshift-merge-robot
Copy link
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.

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2017
@pravisankar
Copy link

/retest

@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot
Copy link
Contributor

Automatic merge from submit-queue.

@openshift-merge-robot openshift-merge-robot merged commit 4137a50 into openshift:master Oct 29, 2017
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants