provider

package
v1.12.3-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BackupFunc = kopia.Backup

BackupFunc mainly used to make testing more convenient

View Source
var BackupRepoServiceCreateFunc = service.Create
View Source
var ErrorCanceled error = errors.New("uploader is canceled")
View Source
var RestoreFunc = kopia.Restore

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// RunBackup which will do backup for one specific volume and return snapshotID, isSnapshotEmpty, error
	// updater is used for updating backup progress which implement by third-party
	RunBackup(
		ctx context.Context,
		path string,
		realSource string,
		tags map[string]string,
		forceFull bool,
		parentSnapshot string,
		volMode uploader.PersistentVolumeMode,
		updater uploader.ProgressUpdater) (string, bool, error)
	// RunRestore which will do restore for one specific volume with given snapshot id and return error
	// updater is used for updating backup progress which implement by third-party
	RunRestore(
		ctx context.Context,
		snapshotID string,
		volumePath string,
		volMode uploader.PersistentVolumeMode,
		updater uploader.ProgressUpdater) error
	// Close which will close related repository
	Close(ctx context.Context) error
}

Provider which is designed for one pod volume to do the backup or restore

func NewKopiaUploaderProvider

func NewKopiaUploaderProvider(
	requestorType string,
	ctx context.Context,
	credGetter *credentials.CredentialGetter,
	backupRepo *velerov1api.BackupRepository,
	log logrus.FieldLogger,
) (Provider, error)

NewKopiaUploaderProvider initialized with open or create a repository

func NewResticUploaderProvider

func NewResticUploaderProvider(
	repoIdentifier string,
	bsl *velerov1api.BackupStorageLocation,
	credGetter *credentials.CredentialGetter,
	repoKeySelector *v1.SecretKeySelector,
	log logrus.FieldLogger,
) (Provider, error)

func NewUploaderProvider

func NewUploaderProvider(
	ctx context.Context,
	client client.Client,
	uploaderType string,
	requesterType string,
	repoIdentifier string,
	bsl *velerov1api.BackupStorageLocation,
	backupRepo *velerov1api.BackupRepository,
	credGetter *credentials.CredentialGetter,
	repoKeySelector *v1.SecretKeySelector,
	log logrus.FieldLogger,
) (Provider, error)

NewUploaderProvider initialize provider with specific uploaderType

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL