-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Add LabelSelector to PersistentVolumeClaimSpec #25917
Conversation
@@ -360,6 +360,8 @@ type PersistentVolumeClaimList struct { | |||
type PersistentVolumeClaimSpec struct { | |||
// Contains the types of access modes required | |||
AccessModes []PersistentVolumeAccessMode `json:"accessModes,omitempty"` | |||
// PersistentVolumeSelector is a selector which must be true for the claim to bind to a volume | |||
LabelSelector *unversioned.LabelSelector `json:"labelSelector,omitempty"` |
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.
I'd just call it selector
.
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.
ack
@k8s-bot test this issue: #IGNORE |
// selector, if specified | ||
if volume.Spec.ClaimRef == nil { | ||
if claim.Spec.LabelSelector != nil { | ||
internalSelector, err := unversioned.LabelSelectorAsSelector(claim.Spec.LabelSelector) |
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.
I'd create the internalSelector only once, outside the loop and then reuse it for matching.
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.
fixed locally
@jsafrane feedback addressed, PTAL |
nicely done, LGTM |
Test failures are actually my bad. Fixing. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit acfcb73. |
Automatic merge from submit-queue |
Implements #25413.
@kubernetes/sig-storage @bgrant0607 @thockin @jsafrane @eparis