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
Check claimRef UID when processing a recycled PV #23078
Conversation
|
Labelling this PR as size/XS |
|
GCE e2e build/test passed for commit b77abe5. |
|
Good catch, LGTM. |
|
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
|
GCE e2e build/test passed for commit b77abe5. |
| @@ -238,7 +238,7 @@ func syncVolume(volumeIndex *persistentVolumeOrderedIndex, binderClient binderCl | |||
|
|
|||
| if volume.Spec.ClaimRef != nil { | |||
| claim, err := binderClient.GetPersistentVolumeClaim(volume.Spec.ClaimRef.Namespace, volume.Spec.ClaimRef.Name) | |||
| if errors.IsNotFound(err) { | |||
| if errors.IsNotFound(err) || (claim != nil && claim.UID != volume.Spec.ClaimRef.UID) { | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: log this for debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add in a follow up PR (I'm not going to remove LGTM).
|
LGTM mod nit |
|
@swagiaal tests failed |
|
@ncdc |
|
@k8s-bot test this Tests are more than 48 hours old. Re-running tests. |
|
GCE e2e build/test passed for commit b77abe5. |
|
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
|
GCE e2e build/test passed for commit b77abe5. |
|
Automatic merge from submit-queue |
After a volume is recycled and it is in the pending state if a new PVC is created with the same name that the old PV was bound to, the newly recycled PV never gets to the Available state. This patch corrects that
@jsafrane WDYT ?