provider

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NewVeleroProvider = func(ecosystemClientSet EcosystemClientSet, recorder EventRecorder, namespace string) (Provider, error) {
	return velero.NewDefaultProvider(ecosystemClientSet, namespace, recorder)
}

Functions

This section is empty.

Types

type EcosystemClientSet added in v0.7.0

type EcosystemClientSet interface {
	ecosystem.Interface
}

type EventRecorder

type EventRecorder interface {
	record.EventRecorder
}

EventRecorder provides functionality to commit events to kubernetes resources.

type Provider

type Provider interface {
	// CreateBackup creates backup according to the backup configuration in v1.Backup.
	CreateBackup(ctx context.Context, backup *v1.Backup) error
	// DeleteBackup deletes backup from the cluster state and the backup storage.
	DeleteBackup(ctx context.Context, backup *v1.Backup) error
	// CheckReady validates if the provider is ready to receive backup requests.
	CheckReady(ctx context.Context) error
	// CreateRestore creates a restore according to the restore configuration in v1.Restore.
	CreateRestore(ctx context.Context, restore *v1.Restore) error
	// DeleteRestore just deletes the provider restore object.
	DeleteRestore(ctx context.Context, restore *v1.Restore) error
	// SyncBackups syncs backup CRs with provider backups.
	SyncBackups(ctx context.Context) error
	// SyncBackupStatus syncs the status of the backup CR with the corresponding provider backup.
	// The provider backup must be completed or an error is thrown.
	SyncBackupStatus(ctx context.Context, backup *v1.Backup) error
}

Provider encapsulates different provider like velero.

func GetProvider

func GetProvider(ctx context.Context, object runtime.Object, name k8sv1.Provider, namespace string, recorder EventRecorder, ecosystemClientSet EcosystemClientSet) (Provider, error)

GetProvider returns the provider by the given name and calls a function on the provider object to check if it is ready.

Jump to

Keyboard shortcuts

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