Fetch contents based on volumesnapshots found

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
pull/2323/head
Nolan Brubaker 2020-04-17 18:42:14 -04:00
parent bc04c568cd
commit 16cf2780d8
1 changed files with 8 additions and 4 deletions

View File

@ -562,10 +562,14 @@ func (c *backupController) runBackup(backup *pkgbackup.Request) error {
}
if c.volumeSnapshotContentLister != nil {
volumeSnapshotContents, err = c.volumeSnapshotContentLister.List(selector)
if err != nil {
backupLog.Error(err)
// Since VolumeSnapshotContent objects are not currently labeled, get them by using binding from the VolumeSnapshot
for _, vs := range volumeSnapshots {
vsc, err := c.volumeSnapshotContentLister.Get(*vs.Status.BoundVolumeSnapshotContentName)
if err != nil {
backupLog.Error(err)
continue
}
volumeSnapshotContents = append(volumeSnapshotContents, vsc)
}
}
}