backup

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 53 Imported by: 21

Documentation

Index

Constants

View Source
const BackupFormatVersion = "1.1.0"

BackupFormatVersion is the current backup version for Velero, including major, minor, and patch.

View Source
const BackupVersion = 1

BackupVersion is the current backup major version for Velero. Deprecated, use BackupFormatVersion

Variables

This section is empty.

Functions

func GetBackupCSIResources added in v1.12.3

func GetBackupCSIResources(
	client kbclient.Client,
	globalCRClient kbclient.Client,
	backup *velerov1api.Backup,
	backupLog logrus.FieldLogger,
) (
	volumeSnapshots []snapshotv1api.VolumeSnapshot,
	volumeSnapshotContents []snapshotv1api.VolumeSnapshotContent,
	volumeSnapshotClasses []snapshotv1api.VolumeSnapshotClass,
)

GetBackupCSIResources is used to get CSI snapshot related resources. Returns VolumeSnapshot, VolumeSnapshotContent, VolumeSnapshotClasses referenced

func NewDeleteBackupRequest added in v0.8.0

func NewDeleteBackupRequest(name string, uid string) *velerov1api.DeleteBackupRequest

NewDeleteBackupRequest creates a DeleteBackupRequest for the backup identified by name and uid.

func NewDeleteBackupRequestListOptions added in v0.8.0

func NewDeleteBackupRequestListOptions(name, uid string) metav1.ListOptions

NewDeleteBackupRequestListOptions creates a ListOptions with a label selector configured to find DeleteBackupRequests for the backup identified by name and uid.

func NewSkipPVTracker added in v1.12.0

func NewSkipPVTracker() *skipPVTracker

Types

type Backupper

type Backupper interface {
	// Backup takes a backup using the specification in the velerov1api.Backup and writes backup and log data
	// to the given writers.
	Backup(
		logger logrus.FieldLogger,
		backup *Request,
		backupFile io.Writer,
		actions []biav2.BackupItemAction,
		volumeSnapshotterGetter VolumeSnapshotterGetter,
	) error

	BackupWithResolvers(
		log logrus.FieldLogger,
		backupRequest *Request,
		backupFile io.Writer,
		backupItemActionResolver framework.BackupItemActionResolverV2,
		volumeSnapshotterGetter VolumeSnapshotterGetter,
	) error

	FinalizeBackup(
		log logrus.FieldLogger,
		backupRequest *Request,
		inBackupFile io.Reader,
		outBackupFile io.Writer,
		backupItemActionResolver framework.BackupItemActionResolverV2,
		asyncBIAOperations []*itemoperation.BackupOperation,
	) error
}

Backupper performs backups.

func NewKubernetesBackupper

func NewKubernetesBackupper(
	kbClient kbclient.Client,
	discoveryHelper discovery.Helper,
	dynamicFactory client.DynamicFactory,
	podCommandExecutor podexec.PodCommandExecutor,
	podVolumeBackupperFactory podvolume.BackupperFactory,
	podVolumeTimeout time.Duration,
	defaultVolumesToFsBackup bool,
	clientPageSize int,
	uploaderType string,
	pluginManager func(logrus.FieldLogger) clientmgmt.Manager,
	backupStoreGetter persistence.ObjectBackupStoreGetter,
) (Backupper, error)

NewKubernetesBackupper creates a new kubernetesBackupper.

type FileForArchive added in v1.11.0

type FileForArchive struct {
	FilePath  string
	Header    *tar.Header
	FileBytes []byte
}

type PVSkipReason added in v1.12.0

type PVSkipReason struct {
	Approach string `json:"approach"`
	Reason   string `json:"reason"`
}

type Request added in v0.10.0

type Request struct {
	*velerov1api.Backup

	StorageLocation           *velerov1api.BackupStorageLocation
	SnapshotLocations         []*velerov1api.VolumeSnapshotLocation
	NamespaceIncludesExcludes *collections.IncludesExcludes
	ResourceIncludesExcludes  collections.IncludesExcludesInterface
	ResourceHooks             []hook.ResourceHook
	ResolvedActions           []framework.BackupItemResolvedActionV2
	VolumeSnapshots           []*volume.Snapshot
	PodVolumeBackups          []*velerov1api.PodVolumeBackup
	BackedUpItems             map[itemKey]struct{}

	ResPolicies        *resourcepolicies.Policies
	SkippedPVTracker   *skipPVTracker
	VolumesInformation volume.BackupVolumesInformation
	// contains filtered or unexported fields
}

Request is a request for a backup, with all references to other objects materialized (e.g. backup/snapshot locations, includes/excludes, etc.)

func (*Request) BackupResourceList added in v1.0.1

func (r *Request) BackupResourceList() map[string][]string

BackupResourceList returns the list of backed up resources grouped by the API Version and Kind

func (*Request) FillVolumesInformation added in v1.13.0

func (r *Request) FillVolumesInformation()

func (*Request) GetItemOperationsList added in v1.11.0

func (r *Request) GetItemOperationsList() *[]*itemoperation.BackupOperation

GetItemOperationsList returns ItemOperationsList, initializing it if necessary

type SkippedPV added in v1.12.0

type SkippedPV struct {
	Name    string         `json:"name"`
	Reasons []PVSkipReason `json:"reasons"`
}

func (*SkippedPV) SerializeSkipReasons added in v1.13.0

func (s *SkippedPV) SerializeSkipReasons() string

type VolumeSnapshotterGetter added in v1.0.0

type VolumeSnapshotterGetter interface {
	GetVolumeSnapshotter(name string) (vsv1.VolumeSnapshotter, error)
}

Directories

Path Synopsis
csi

Jump to

Keyboard shortcuts

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