Add support for In-place snapshot restore#353
Conversation
Codecov Report
@@ Coverage Diff @@
## master #353 +/- ##
==========================================
+ Coverage 74.22% 74.37% +0.15%
==========================================
Files 27 27
Lines 2471 2494 +23
==========================================
+ Hits 1834 1855 +21
- Misses 479 480 +1
- Partials 158 159 +1
Continue to review full report at Codecov.
|
disrani-px
left a comment
There was a problem hiding this comment.
Good to merge after fixing minor comments and adding UT for changes in extender.go
| pvc, err := k8s.Instance().GetPersistentVolumeClaim(vol.PersistentVolumeClaim.ClaimName, pod.Namespace) | ||
| if err != nil { | ||
| msg := "Unable to find PVC %s" + vol.Name | ||
| storklog.PodLog(pod).Warnf(msg) |
There was a problem hiding this comment.
I think the Event and http.Error(...) got removed when merging the other PR
There was a problem hiding this comment.
yes, thanks for pointing out. Do we need to check nil for pod.Spec here
There was a problem hiding this comment.
No, PodLog() checks for nil
|
I have changed UT's for fake k8s client responses, @disrani-px please take look at extender_test.go |
|
@ram-infrac Changes look good! |
| pvc, err := k8s.Instance().GetPersistentVolumeClaim(vol.PersistentVolumeClaim.ClaimName, pod.Namespace) | ||
| if err != nil { | ||
| msg := "Unable to find PVC %s" + vol.Name | ||
| storklog.PodLog(pod).Warnf(msg) |
There was a problem hiding this comment.
No, PodLog() checks for nil
|
Please squash the intermediate commits before merging. |
- codegen generated files - Add controller for In-place snapshot restore - Add support for local groupsnapshot in-place restore - Fix go-lint errors - Review comments - Check restore status before calling driver's snapshot restore - codegen generated files Signed-off-by: Ram <ram.suradkar@portworx.com>
- Fix go-lint errors - Review comments - Generated files for changed volumesnapshotCRD's - Restore snapshot where pvc is in use by pods - Move controller specific login from portworx driver to snapshot restore controller - Generated files by codegen - Review comments Signed-off-by: Ram <ram.suradkar@portworx.com>
- address review comments - nil check for pvcclaim Signed-off-by: Ram <ram.suradkar@portworx.com>
- adjust ut's to create pvc - address review comments Signed-off-by: Ram <ram.suradkar@portworx.com>
What type of PR is this?
feature
What this PR does / why we need it:
This PR add in-place restore support for volume snapshots. Snapshot now can be restored to origin volumes
Does this PR change a user-facing CRD or CLI?:
We have new CRD for In-place volume snapshot restore.
eg.
sourcetype: snapshot type either local or cloud
sourcename: name of snapshot to be restore
groupsnapshot: true if snapshot is
volumegroupsnapshotIs a release note needed?:
Does this change need to be cherry-picked to a release branch?: