-
Notifications
You must be signed in to change notification settings - Fork 38.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 PVC nil pointer dereference during migration-enabled volume expand #111894
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Wed Aug 17 13:39:06 UTC 2022. |
@wongma7: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions 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/test-infra repository. |
/sig storage |
/retest (looks like flake failures) |
I checked the code btw and I think 1.24, 1.23 and master are safe. The bug might only exist in 1.22 or older versions of Kubernetes. |
yeah, because of 1ddd598 actually it looks like it is impossible for PatchPVCStatus and thus SetClaimResizer to return nil pvc in 1.23+*. How should I proceed, just open a PR directly to 1.22, or merge this in master as a 'code hygiene' kind of change and cherry-pick to 1.22? |
I kind of feel bad about leaving broken code in 1.22 because fix we are putting here does not directly fix the issue and there may be more "users" of the Lets accept this PR anyways and then while backporting to 1.22 fix the |
/lgtm |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gnufied, wongma7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test pull-kubernetes-e2e-gce-storage-snapshot |
What type of PR is this?
/kind bug
What this PR does / why we need it:
#111891 reported nil pointer dereference in KCM. Stack trace shows it happened because
SetClaimResizer
returned nil pvc and non-nil err, this nil PVC was passed toClaimToClaimKey
which panicked.I think it is also possible for nil pointer dereference to happen at the informer
Get
which could also return nil pvc and non-nil err so I updated that as well to avoid dereferencing pvc object.Finally, I updated every other place in this function that tries to call either
util.ClaimToClaimKey(pvc)
orutil.GetPersistentVolumeClaimQualifiedName(pvc)
for consistency and because they're unnecessary when we already have thekey
Which issue(s) this PR fixes:
Fixes #111891
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: