backup

package
v0.0.0-...-c1b1270 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 55 Imported by: 0

Documentation

Index

Constants

View Source
const ArgoCDManagedByNamespaceLabel = "argocd.argoproj.io/managed-by"

ArgoCD managed by namespace label key

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

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 NewBackedUpItemsMap

func NewBackedUpItemsMap() *backedUpItemsMap

func NewDeleteBackupRequest

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

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

func NewDeleteBackupRequestListOptions

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

func NewSkipPVTracker() *skipPVTracker

Types

type BackupItemBlock

type BackupItemBlock struct {
	itemblock.ItemBlock
	// contains filtered or unexported fields
}

func NewBackupItemBlock

func NewBackupItemBlock(log logrus.FieldLogger, itemBackupper *itemBackupper) *BackupItemBlock

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,
		itemBlockActions []ibav1.ItemBlockAction,
		volumeSnapshotterGetter VolumeSnapshotterGetter,
	) error

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

	FinalizeBackup(
		log logrus.FieldLogger,
		backupRequest *Request,
		inBackupFile io.Reader,
		outBackupFile io.Writer,
		backupItemActionResolver framework.BackupItemActionResolverV2,
		asyncBIAOperations []*itemoperation.BackupOperation,
		backupStore persistence.BackupStore,
	) 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

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

type PVSkipReason

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

type Request

type Request struct {
	*velerov1api.Backup

	StorageLocation           *velerov1api.BackupStorageLocation
	SnapshotLocations         []*velerov1api.VolumeSnapshotLocation
	NamespaceIncludesExcludes *collections.IncludesExcludes
	ResourceIncludesExcludes  collections.IncludesExcludesInterface
	ResourceHooks             []hook.ResourceHook
	ResolvedActions           []framework.BackupItemResolvedActionV2
	ResolvedItemBlockActions  []framework.ItemBlockResolvedAction
	VolumeSnapshots           []*volume.Snapshot
	PodVolumeBackups          []*velerov1api.PodVolumeBackup
	BackedUpItems             *backedUpItemsMap

	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

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

func (r *Request) FillVolumesInformation()

func (*Request) GetItemOperationsList

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

GetItemOperationsList returns ItemOperationsList, initializing it if necessary

type SkippedPV

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

func (*SkippedPV) SerializeSkipReasons

func (s *SkippedPV) SerializeSkipReasons() string

type VolumeSnapshotterGetter

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