-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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
Avoid panic in Cloud CIDR Allocator #58186
Conversation
This allows us to fail fast if the node doesn't exist, and to record node status changes if we fail to 'allocate' a CIDR.
/assign @shyamjvs |
/ok-to-test |
/retest |
1 similar comment
/retest |
/test pull-kubernetes-cross |
/lgtm |
/lgtm /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bowei, dixudx, freehan, negz Associated issue: #58181 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 |
/test pull-kubernetes-cross Pretty sure this failure is unrelated to my PR. |
Automatic merge from submit-queue (batch tested with PRs 57266, 58187, 58186, 46245, 56509). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Let's cherry pick this to 1.9 |
…This is a backport of kubernetes#58186. We cannot intact backport to it due to a refactor PR kubernetes#56352.
Automatic merge from submit-queue. Initialize node ahead in case we need to refer to it in error cases Initialize node ahead in case we need to refer to it in error cases. This is a backport of #58186. We cannot intact backport to it due to a refactor PR #56352. **What this PR does / why we need it**: We want to cherry pick to 1.9. Master already has the fix. **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #58181 **Special notes for your reviewer**: **Release note**: ```release-note Avoid controller-manager to crash when enabling IP alias for K8s cluster. ```
Commit found in the "release-1.9" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
What this PR does / why we need it:
I suspect a race exists where we attempt to look up the CIDR for a terminating node. By the time
updateCIDRAllocation
is called the node has disappeared. We determine it does not have a cloud CIDR (i.e. Alias IP Range) and attempt to record aCIDRNotAvailable
node status. Unfortunately we referencenode.Name
whilenode
is still nil.By getting the node before looking up the cloud CIDR we avoid the nil pointer dereference, and potentially fail fast in the case the node has disappeared.
Which issue(s) this PR fixes:
Fixes #58181
Release note: