Document locations for CSI support

Signed-off-by: Nolan Brubaker <brubakern@vmware.com>
This commit is contained in:
Nolan Brubaker
2020-03-03 15:57:15 -05:00
parent 33e154f0d9
commit b4be7eccb9
3 changed files with 12 additions and 1 deletions

View File

@@ -40,6 +40,7 @@ import (
velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1"
pkgbackup "github.com/vmware-tanzu/velero/pkg/backup"
"github.com/vmware-tanzu/velero/pkg/discovery"
"github.com/vmware-tanzu/velero/pkg/features"
velerov1client "github.com/vmware-tanzu/velero/pkg/generated/clientset/versioned/typed/velero/v1"
velerov1informers "github.com/vmware-tanzu/velero/pkg/generated/informers/externalversions/velero/v1"
velerov1listers "github.com/vmware-tanzu/velero/pkg/generated/listers/velero/v1"
@@ -74,6 +75,8 @@ type backupController struct {
formatFlag logging.Format
}
// TODO (nrb): Add clients for the VS/VSContent here.
// How about creating them in the server iff EnableCSI, and if they're nil in the backup controller, don't worry about it?
func NewBackupController(
backupInformer velerov1informers.BackupInformer,
client velerov1client.BackupsGetter,
@@ -599,6 +602,11 @@ func recordBackupMetrics(log logrus.FieldLogger, backup *velerov1api.Backup, bac
}
func persistBackup(backup *pkgbackup.Request, backupContents, backupLog *os.File, backupStore persistence.BackupStore, log logrus.FieldLogger) []error {
if features.IsEnabled("EnableCSI") {
// Get the list of VolumeSnapshots & VolumeSnapshotContents associated with the backup and serialize them as JSON
// Probably shouldn't fetch them here as there's no client, but they should be passed in somehow.
}
errs := []error{}
backupJSON := new(bytes.Buffer)

View File

@@ -42,6 +42,7 @@ type BackupInfo struct {
PodVolumeBackups,
VolumeSnapshots,
BackupResourceList io.Reader
// Add io.Readers here for VS and VSContents lists?
}
// BackupStore defines operations for creating, retrieving, and deleting
@@ -51,7 +52,7 @@ type BackupStore interface {
ListBackups() ([]string, error)
PutBackup(info BackupInfo) error
PutBackup(info BackupInfo) error // Extend this method for a VS/VSContent parameter, or create a new one for the beta period?
GetBackupMetadata(name string) (*velerov1api.Backup, error)
GetBackupVolumeSnapshots(name string) ([]*volume.Snapshot, error)
GetPodVolumeBackups(name string) ([]*velerov1api.PodVolumeBackup, error)

View File

@@ -99,3 +99,5 @@ func (l *ObjectStoreLayout) getRestoreLogKey(restore string) string {
func (l *ObjectStoreLayout) getRestoreResultsKey(restore string) string {
return path.Join(l.subdirs["restores"], restore, fmt.Sprintf("restore-%s-results.gz", restore))
}
// TODO: Add keys for VS & VSContents json.gz files