Skip to content

Commit

Permalink
pb-3831: In csi driver CancelRestore, cleaning up dangling PVC, if re…
Browse files Browse the repository at this point in the history
…store is not succeed and retain as well
  • Loading branch information
sivakumar subraani authored and siva-portworx committed May 5, 2023
1 parent 02e966a commit 2bebe98
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/volume/csi/csi.go
Original file line number Diff line number Diff line change
Expand Up @@ -1683,7 +1683,10 @@ func (c *csi) CancelRestore(restore *storkapi.ApplicationRestore) error {
if vrInfo.DriverName != storkvolume.CSIDriverName {
continue
}
pvcRestoreSucceeded := (vrInfo.Status == storkapi.ApplicationRestoreStatusPartialSuccess || vrInfo.Status == storkapi.ApplicationRestoreStatusSuccessful)
// For existing volume, the status will be retained.
pvcRestoreSucceeded := (vrInfo.Status == storkapi.ApplicationRestoreStatusPartialSuccess ||
vrInfo.Status == storkapi.ApplicationRestoreStatusSuccessful ||
vrInfo.Status == storkapi.ApplicationRestoreStatusRetained)

// Only clean up dangling PVC if it's restore did not succeed
if !pvcRestoreSucceeded {
Expand Down

0 comments on commit 2bebe98

Please sign in to comment.