-
Notifications
You must be signed in to change notification settings - Fork 6
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
pb-5438: Resetting the pvc.Spec.Selector in the kdmp and csi as it is dynamic provisioning. #343
Conversation
… dynamic provisioning.
OSS Scan Results:
Total issues: 47 |
License Evaluation Results:
Total License Issues: 19 |
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.
lgtm
@@ -1737,6 +1737,11 @@ func (c *Controller) restoreSnapshot(ctx context.Context, snapshotDriver snapsho | |||
|
|||
func (c *Controller) createPVC(dataExport *kdmpapi.DataExport) (*corev1.PersistentVolumeClaim, error) { | |||
pvc := dataExport.Status.RestorePVC | |||
if pvc.Spec.Selector != nil { | |||
// Remove the labelselector, as it is a dynamic provisioning. |
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.
In a case where PVC is referenced to a PV not by name and based on label selector how would this work?
Eg
PV spec
apiVersion: v1
kind: PersistentVolume
metadata:
name: test-pv
labels:
volume-type: ssd
PVC spec as follows which doesn't specify volumeMount but looks for a PV to match the label selector.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
selector:
matchLabels:
volume-type: ssd
What this PR does / why we need it:
Which issue(s) this PR fixes (optional)
Closes # pb-5438
Special notes for your reviewer:
Note:
Testing:
With out fix, it failing while restore as restore PVC was struck in "Pending" state"
With fix, the PVC Is bounded as the label selector is removed: