Skip to content

Commit

Permalink
cherry-pick(fix, statefuleset): fixing storageclass for STS if mentio…
Browse files Browse the repository at this point in the history
…ned in annotation (#49)

Signed-off-by: mayank <[email protected]>
  • Loading branch information
mynktl authored and vishnuitta committed Jan 8, 2020
1 parent 4ffd68b commit 338d057
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/cstor/pvc_operation.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ func (p *Plugin) backupPVC(volumeID string) error {

bkpPvc.ResourceVersion = ""
bkpPvc.SelfLink = ""
if bkpPvc.Spec.StorageClassName == nil || len(*bkpPvc.Spec.StorageClassName) == 0 {
sc := bkpPvc.Annotations[v1.BetaStorageClassAnnotation]
bkpPvc.Spec.StorageClassName = &sc
}

bkpPvc.Annotations = nil
bkpPvc.UID = ""
bkpPvc.Spec.VolumeName = ""
Expand Down

0 comments on commit 338d057

Please sign in to comment.