Documentation ¶
Index ¶
- Constants
- func NewClusterRoleBindingListerMap(clientset kubernetes.Interface) map[string]ClusterRoleBindingLister
- func NewDeleteBackupRequest(name string, uid string) *velerov1api.DeleteBackupRequest
- func NewDeleteBackupRequestListOptions(name, uid string) metav1.ListOptions
- func NewSkipPVTracker() *skipPVTracker
- func UpdateBackupCSISnapshotsStatus(client kbclient.Client, ...) (volumeSnapshots []snapshotv1api.VolumeSnapshot, ...)
- type Backupper
- type ClusterRoleBinding
- type ClusterRoleBindingLister
- type FileForArchive
- type PVCAction
- type PVSkipReason
- type PodAction
- type RemapCRDVersionAction
- type Request
- type ServiceAccountAction
- type SkippedPV
- type VolumeSnapshotterGetter
Constants ¶
const BackupFormatVersion = "1.1.0"
BackupFormatVersion is the current backup version for Velero, including major, minor, and patch.
const BackupVersion = 1
BackupVersion is the current backup major version for Velero. Deprecated, use BackupFormatVersion
Variables ¶
This section is empty.
Functions ¶
func NewClusterRoleBindingListerMap ¶ added in v0.9.1
func NewClusterRoleBindingListerMap(clientset kubernetes.Interface) map[string]ClusterRoleBindingLister
NewClusterRoleBindingListerMap creates a map of RBAC version strings to their associated ClusterRoleBindingLister structs. Necessary so that callers to the ClusterRoleBindingLister interfaces don't need the kubernetes.Interface.
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
func UpdateBackupCSISnapshotsStatus ¶ added in v1.12.2
func UpdateBackupCSISnapshotsStatus(client kbclient.Client, volumeSnapshotLister snapshotv1listers.VolumeSnapshotLister, backup *velerov1api.Backup, backupLog logrus.FieldLogger) (volumeSnapshots []snapshotv1api.VolumeSnapshot, volumeSnapshotContents []snapshotv1api.VolumeSnapshotContent, volumeSnapshotClasses []snapshotv1api.VolumeSnapshotClass)
Common function to update the status of CSI snapshots returns VolumeSnapshot, VolumeSnapshotContent, VolumeSnapshotClasses referenced
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, ) (Backupper, error)
NewKubernetesBackupper creates a new kubernetesBackupper.
type ClusterRoleBinding ¶ added in v0.9.1
type ClusterRoleBinding interface { // Name returns the name of a ClusterRoleBinding. Name() string // ServiceAccountSubjects returns the names of subjects that are service accounts in the given namespace. ServiceAccountSubjects(namespace string) []string // RoleRefName returns the name of a ClusterRoleBinding's RoleRef. RoleRefName() string }
ClusterRoleBinding abstracts access to ClusterRoleBindings whether they're v1 or v1beta1.
type ClusterRoleBindingLister ¶ added in v0.9.1
type ClusterRoleBindingLister interface { // List returns a slice of ClusterRoleBindings which can represent either v1 or v1beta1 ClusterRoleBindings. List() ([]ClusterRoleBinding, error) }
ClusterRoleBindingLister allows for listing ClusterRoleBindings in a version-independent way.
type FileForArchive ¶ added in v1.11.0
type PVCAction ¶ added in v1.0.0
type PVCAction struct {
// contains filtered or unexported fields
}
PVCAction inspects a PersistentVolumeClaim for the PersistentVolume that it references and backs it up
func NewPVCAction ¶ added in v1.0.0
func NewPVCAction(logger logrus.FieldLogger) *PVCAction
func (*PVCAction) AppliesTo ¶ added in v1.0.0
func (a *PVCAction) AppliesTo() (velero.ResourceSelector, error)
func (*PVCAction) Execute ¶ added in v1.0.0
func (a *PVCAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute finds the PersistentVolume bound by the provided PersistentVolumeClaim, if any, and backs it up
type PVSkipReason ¶ added in v1.12.0
type PodAction ¶ added in v1.0.0
type PodAction struct {
// contains filtered or unexported fields
}
PodAction implements ItemAction.
func NewPodAction ¶ added in v0.7.0
func NewPodAction(logger logrus.FieldLogger) *PodAction
NewPodAction creates a new ItemAction for pods.
func (*PodAction) AppliesTo ¶ added in v1.0.0
func (a *PodAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo returns a ResourceSelector that applies only to pods.
func (*PodAction) Execute ¶ added in v1.0.0
func (a *PodAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute scans the pod's spec.volumes for persistentVolumeClaim volumes and returns a ResourceIdentifier list containing references to all of the persistentVolumeClaim volumes used by the pod. This ensures that when a pod is backed up, all referenced PVCs are backed up too.
type RemapCRDVersionAction ¶ added in v1.3.0
type RemapCRDVersionAction struct {
// contains filtered or unexported fields
}
RemapCRDVersionAction inspects CustomResourceDefinition and decides if it is a v1 CRD that needs to be backed up as v1beta1.
func NewRemapCRDVersionAction ¶ added in v1.3.0
func NewRemapCRDVersionAction(logger logrus.FieldLogger, betaCRDClient apiextv1beta1client.CustomResourceDefinitionInterface, discoveryHelper velerodiscovery.Helper) *RemapCRDVersionAction
NewRemapCRDVersionAction instantiates a new RemapCRDVersionAction plugin.
func (*RemapCRDVersionAction) AppliesTo ¶ added in v1.3.0
func (a *RemapCRDVersionAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo selects the resources the plugin should run against. In this case, CustomResourceDefinitions.
func (*RemapCRDVersionAction) Execute ¶ added in v1.3.0
func (a *RemapCRDVersionAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute executes logic necessary to check a CustomResourceDefinition and inspect it for characteristics that necessitate saving it as v1beta1 instead of v1.
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 // 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
BackupResourceList returns the list of backed up resources grouped by the API Version and Kind
func (*Request) GetItemOperationsList ¶ added in v1.11.0
func (r *Request) GetItemOperationsList() *[]*itemoperation.BackupOperation
GetItemOperationsList returns ItemOperationsList, initializing it if necessary
type ServiceAccountAction ¶ added in v1.0.0
type ServiceAccountAction struct {
// contains filtered or unexported fields
}
ServiceAccountAction implements ItemAction.
func NewServiceAccountAction ¶ added in v0.9.0
func NewServiceAccountAction(logger logrus.FieldLogger, clusterRoleBindingListers map[string]ClusterRoleBindingLister, discoveryHelper velerodiscovery.Helper) (*ServiceAccountAction, error)
NewServiceAccountAction creates a new ItemAction for service accounts.
func (*ServiceAccountAction) AppliesTo ¶ added in v1.0.0
func (a *ServiceAccountAction) AppliesTo() (velero.ResourceSelector, error)
AppliesTo returns a ResourceSelector that applies only to service accounts.
func (*ServiceAccountAction) Execute ¶ added in v1.0.0
func (a *ServiceAccountAction) Execute(item runtime.Unstructured, backup *v1.Backup) (runtime.Unstructured, []velero.ResourceIdentifier, error)
Execute checks for any ClusterRoleBindings that have this service account as a subject, and adds the ClusterRoleBinding and associated ClusterRole to the list of additional items to be backed up.
type SkippedPV ¶ added in v1.12.0
type SkippedPV struct { Name string `json:"name"` Reasons []PVSkipReason `json:"reasons"` }
type VolumeSnapshotterGetter ¶ added in v1.0.0
type VolumeSnapshotterGetter interface {
GetVolumeSnapshotter(name string) (vsv1.VolumeSnapshotter, error)
}