loadbalancer_sg: nil-check subnet.Extract result#3105
loadbalancer_sg: nil-check subnet.Extract result#3105SAY-5 wants to merge 1 commit intokubernetes:masterfrom
Conversation
|
Welcome @SAY-5! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @SAY-5. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
The fix seems reasonable given the However, you need to fix the commit message and add the missing release note section to the PR summary before we can test and merge this. |
| return fmt.Errorf( | ||
| "failed to find subnet %s from openstack: %v", svcConf.lbMemberSubnetID, err) | ||
| } | ||
| if subnet == nil { |
There was a problem hiding this comment.
IMHO this check needs to be implemented in gophercloud
Refs kubernetes#3101. subnets.Get(...).Extract() can return a nil Subnet with no error in some OpenStack misconfigurations, and dereferencing subnet.CIDR then SIGSEGVs the OCCM service worker into CrashLoopBackOff. Treat the nil result as not-found and continue. Signed-off-by: SAY-5 <say.apm35@gmail.com>
aba0c73 to
c52bd29
Compare
|
Updated commit message + added release note. Thanks @stephenfin! |
What this PR does / why we need it:
subnets.Get(...).Extract()can return a nilSubnetwith no error in some OpenStack misconfigurations. Dereferencingsubnet.CIDRthen SIGSEGVs the OCCM service worker into CrashLoopBackOff. This adds a nil check that treats the nil result as not-found and continues, matching the existing 404 path.Which issue this PR fixes(if applicable):
fixes #3101
Special notes for reviewers:
The
Subnetfield on the gophercloudGetResultis a pointer and can be nil even whenExtract()returns no error: https://github.com/gophercloud/gophercloud/blob/f4ea62fe7ab75f55496aeaad98a0859170b546eb/openstack/networking/v2/subnets/results.go#L17-L21Release note: