Documentation ¶
Index ¶
- Constants
- Variables
- func NewBackupDeletionReconciler(logger logrus.FieldLogger, client client.Client, backupTracker BackupTracker, ...) *backupDeletionReconciler
- func NewBackupFinalizerReconciler(client kbclient.Client, globalCRClient kbclient.Client, ...) *backupFinalizerReconciler
- func NewBackupOperationsReconciler(logger logrus.FieldLogger, client client.Client, frequency time.Duration, ...) *backupOperationsReconciler
- func NewBackupReconciler(ctx context.Context, discoveryHelper discovery.Helper, ...) *backupReconciler
- func NewBackupStorageLocationReconciler(ctx context.Context, client client.Client, ...) *backupStorageLocationReconciler
- func NewBackupSyncReconciler(client client.Client, namespace string, defaultBackupSyncPeriod time.Duration, ...) *backupSyncReconciler
- func NewDownloadRequestReconciler(client kbclient.Client, clock clocks.Clock, ...) *downloadRequestReconciler
- func NewGCReconciler(logger logrus.FieldLogger, client client.Client, frequency time.Duration) *gcReconciler
- func NewRestoreFinalizerReconciler(logger logrus.FieldLogger, namespace string, client client.Client, ...) *restoreFinalizerReconciler
- func NewRestoreOperationsReconciler(logger logrus.FieldLogger, namespace string, client client.Client, ...) *restoreOperationsReconciler
- func NewRestoreReconciler(ctx context.Context, namespace string, restorer pkgrestore.Restorer, ...) *restoreReconciler
- func NewScheduleReconciler(namespace string, logger logrus.FieldLogger, client client.Client, ...) *scheduleReconciler
- func NewServerStatusRequestReconciler(ctx context.Context, client client.Client, pluginRegistry PluginLister, ...) *serverStatusRequestReconciler
- func UpdateDataDownloadWithRetry(ctx context.Context, client client.Client, namespacedName types.NamespacedName, ...) error
- func UpdateDataUploadWithRetry(ctx context.Context, client client.Client, namespacedName types.NamespacedName, ...) error
- func UpdatePVBStatusToFailed(ctx context.Context, c client.Client, pvb *velerov1api.PodVolumeBackup, ...) error
- func UpdatePVRStatusToFailed(ctx context.Context, c client.Client, pvb *velerov1api.PodVolumeRestore, ...) error
- type BackupRepoReconciler
- type BackupTracker
- type DataDownloadReconciler
- func (r *DataDownloadReconciler) AttemptDataDownloadResume(ctx context.Context, cli client.Client, logger *logrus.Entry, ns string) error
- func (r *DataDownloadReconciler) CancelAcceptedDataDownload(ctx context.Context, cli client.Client, ns string)
- func (r *DataDownloadReconciler) FindDataDownloads(ctx context.Context, cli client.Client, ns string) ([]*velerov2alpha1api.DataDownload, error)
- func (r *DataDownloadReconciler) OnDataDownloadCancelled(ctx context.Context, namespace string, ddName string)
- func (r *DataDownloadReconciler) OnDataDownloadCompleted(ctx context.Context, namespace string, ddName string, result datapath.Result)
- func (r *DataDownloadReconciler) OnDataDownloadFailed(ctx context.Context, namespace string, ddName string, err error)
- func (r *DataDownloadReconciler) OnDataDownloadProgress(ctx context.Context, namespace string, ddName string, ...)
- func (r *DataDownloadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DataDownloadReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *DataDownloadReconciler) TryCancelDataDownload(ctx context.Context, dd *velerov2alpha1api.DataDownload, message string)
- type DataUploadReconciler
- func (r *DataUploadReconciler) AttemptDataUploadResume(ctx context.Context, cli client.Client, logger *logrus.Entry, ns string) error
- func (r *DataUploadReconciler) CancelAcceptedDataupload(ctx context.Context, cli client.Client, ns string)
- func (r *DataUploadReconciler) FindDataUploadsByPod(ctx context.Context, cli client.Client, ns string) ([]velerov2alpha1api.DataUpload, error)
- func (r *DataUploadReconciler) OnDataUploadCancelled(ctx context.Context, namespace string, duName string)
- func (r *DataUploadReconciler) OnDataUploadCompleted(ctx context.Context, namespace string, duName string, result datapath.Result)
- func (r *DataUploadReconciler) OnDataUploadFailed(ctx context.Context, namespace, duName string, err error)
- func (r *DataUploadReconciler) OnDataUploadProgress(ctx context.Context, namespace string, duName string, ...)
- func (r *DataUploadReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *DataUploadReconciler) SetupWithManager(mgr ctrl.Manager) error
- func (r *DataUploadReconciler) TryCancelDataUpload(ctx context.Context, du *velerov2alpha1api.DataUpload, message string)
- type Interface
- type PluginLister
- type PodVolumeBackupReconciler
- func (r *PodVolumeBackupReconciler) OnDataPathCancelled(ctx context.Context, namespace string, pvbName string)
- func (r *PodVolumeBackupReconciler) OnDataPathCompleted(ctx context.Context, namespace string, pvbName string, result datapath.Result)
- func (r *PodVolumeBackupReconciler) OnDataPathFailed(ctx context.Context, namespace, pvbName string, err error)
- func (r *PodVolumeBackupReconciler) OnDataPathProgress(ctx context.Context, namespace string, pvbName string, ...)
- func (r *PodVolumeBackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *PodVolumeBackupReconciler) SetupWithManager(mgr ctrl.Manager) error
- type PodVolumeRestoreReconciler
- func (c *PodVolumeRestoreReconciler) OnDataPathCancelled(ctx context.Context, namespace string, pvrName string)
- func (c *PodVolumeRestoreReconciler) OnDataPathCompleted(ctx context.Context, namespace string, pvrName string, result datapath.Result)
- func (c *PodVolumeRestoreReconciler) OnDataPathFailed(ctx context.Context, namespace string, pvrName string, err error)
- func (c *PodVolumeRestoreReconciler) OnDataPathProgress(ctx context.Context, namespace string, pvrName string, ...)
- func (c *PodVolumeRestoreReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (c *PodVolumeRestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
Constants ¶
const ( Backup = "backup" BackupOperations = "backup-operations" BackupDeletion = "backup-deletion" BackupFinalizer = "backup-finalizer" BackupRepo = "backup-repo" BackupStorageLocation = "backup-storage-location" BackupSync = "backup-sync" DownloadRequest = "download-request" GarbageCollection = "gc" PodVolumeBackup = "pod-volume-backup" PodVolumeRestore = "pod-volume-restore" Restore = "restore" RestoreOperations = "restore-operations" Schedule = "schedule" ServerStatusRequest = "server-status-request" RestoreFinalizer = "restore-finalizer" )
const (
DataUploadDownloadFinalizer = "velero.io/data-upload-download-finalizer"
)
const (
PVPatchMaximumDuration = 10 * time.Minute
)
Variables ¶
var DisableableControllers = []string{ Backup, BackupOperations, BackupDeletion, BackupFinalizer, BackupSync, DownloadRequest, GarbageCollection, BackupRepo, Restore, RestoreOperations, Schedule, ServerStatusRequest, RestoreFinalizer, }
DisableableControllers is a list of controllers that can be disabled
var ExternalResourcesFinalizer = "restores.velero.io/external-resources-finalizer"
Functions ¶
func NewBackupDeletionReconciler ¶ added in v1.9.0
func NewBackupDeletionReconciler( logger logrus.FieldLogger, client client.Client, backupTracker BackupTracker, repoMgr repository.Manager, metrics *metrics.ServerMetrics, helper discovery.Helper, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, credentialStore credentials.FileStore, repoEnsurer *repository.Ensurer, ) *backupDeletionReconciler
NewBackupDeletionReconciler creates a new backup deletion reconciler.
func NewBackupFinalizerReconciler ¶ added in v1.11.0
func NewBackupFinalizerReconciler( client kbclient.Client, globalCRClient kbclient.Client, clock clocks.WithTickerAndDelayedExecution, backupper pkgbackup.Backupper, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupTracker BackupTracker, backupStoreGetter persistence.ObjectBackupStoreGetter, log logrus.FieldLogger, metrics *metrics.ServerMetrics, ) *backupFinalizerReconciler
NewBackupFinalizerReconciler initializes and returns backupFinalizerReconciler struct.
func NewBackupOperationsReconciler ¶ added in v1.11.0
func NewBackupOperationsReconciler( logger logrus.FieldLogger, client client.Client, frequency time.Duration, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, metrics *metrics.ServerMetrics, itemOperationsMap *itemoperationmap.BackupItemOperationsMap, ) *backupOperationsReconciler
func NewBackupReconciler ¶ added in v1.11.0
func NewBackupReconciler( ctx context.Context, discoveryHelper discovery.Helper, backupper pkgbackup.Backupper, logger logrus.FieldLogger, backupLogLevel logrus.Level, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupTracker BackupTracker, kbClient kbclient.Client, defaultBackupLocation string, defaultVolumesToFsBackup bool, defaultBackupTTL time.Duration, defaultCSISnapshotTimeout time.Duration, resourceTimeout time.Duration, defaultItemOperationTimeout time.Duration, defaultSnapshotLocations map[string]string, metrics *metrics.ServerMetrics, backupStoreGetter persistence.ObjectBackupStoreGetter, formatFlag logging.Format, credentialStore credentials.FileStore, maxConcurrentK8SConnections int, defaultSnapshotMoveData bool, globalCRClient kbclient.Client, ) *backupReconciler
func NewBackupStorageLocationReconciler ¶ added in v1.10.0
func NewBackupStorageLocationReconciler( ctx context.Context, client client.Client, defaultBackupLocationInfo storage.DefaultBackupLocationInfo, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, log logrus.FieldLogger) *backupStorageLocationReconciler
NewBackupStorageLocationReconciler initialize and return a backupStorageLocationReconciler struct
func NewBackupSyncReconciler ¶ added in v1.10.0
func NewBackupSyncReconciler( client client.Client, namespace string, defaultBackupSyncPeriod time.Duration, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, logger logrus.FieldLogger) *backupSyncReconciler
NewBackupSyncReconciler is used to generate BackupSync reconciler structure.
func NewDownloadRequestReconciler ¶ added in v1.10.0
func NewDownloadRequestReconciler( client kbclient.Client, clock clocks.Clock, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, log logrus.FieldLogger, backupItemOperationsMap *itemoperationmap.BackupItemOperationsMap, restoreItemOperationsMap *itemoperationmap.RestoreItemOperationsMap, ) *downloadRequestReconciler
NewDownloadRequestReconciler initializes and returns downloadRequestReconciler struct.
func NewGCReconciler ¶ added in v1.10.0
func NewGCReconciler( logger logrus.FieldLogger, client client.Client, frequency time.Duration, ) *gcReconciler
NewGCReconciler constructs a new gcReconciler.
func NewRestoreFinalizerReconciler ¶ added in v1.14.0
func NewRestoreFinalizerReconciler( logger logrus.FieldLogger, namespace string, client client.Client, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, metrics *metrics.ServerMetrics, crClient client.Client, multiHookTracker *hook.MultiHookTracker, ) *restoreFinalizerReconciler
func NewRestoreOperationsReconciler ¶ added in v1.11.0
func NewRestoreOperationsReconciler( logger logrus.FieldLogger, namespace string, client client.Client, frequency time.Duration, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, metrics *metrics.ServerMetrics, itemOperationsMap *itemoperationmap.RestoreItemOperationsMap, ) *restoreOperationsReconciler
func NewRestoreReconciler ¶ added in v1.11.0
func NewRestoreReconciler( ctx context.Context, namespace string, restorer pkgrestore.Restorer, kbClient client.Client, logger logrus.FieldLogger, restoreLogLevel logrus.Level, newPluginManager func(logrus.FieldLogger) clientmgmt.Manager, backupStoreGetter persistence.ObjectBackupStoreGetter, metrics *metrics.ServerMetrics, logFormat logging.Format, defaultItemOperationTimeout time.Duration, disableInformerCache bool, globalCrClient client.Client, ) *restoreReconciler
func NewScheduleReconciler ¶ added in v1.9.0
func NewScheduleReconciler( namespace string, logger logrus.FieldLogger, client client.Client, metrics *metrics.ServerMetrics, skipImmediately bool, ) *scheduleReconciler
func NewServerStatusRequestReconciler ¶ added in v1.10.0
func NewServerStatusRequestReconciler( ctx context.Context, client client.Client, pluginRegistry PluginLister, clock clocks.WithTickerAndDelayedExecution, log logrus.FieldLogger) *serverStatusRequestReconciler
NewServerStatusRequestReconciler initializes and returns serverStatusRequestReconciler struct.
func UpdateDataDownloadWithRetry ¶ added in v1.12.0
func UpdateDataDownloadWithRetry(ctx context.Context, client client.Client, namespacedName types.NamespacedName, log *logrus.Entry, updateFunc func(dataDownload *velerov2alpha1api.DataDownload)) error
func UpdateDataUploadWithRetry ¶ added in v1.12.0
func UpdateDataUploadWithRetry(ctx context.Context, client client.Client, namespacedName types.NamespacedName, log *logrus.Entry, updateFunc func(dataUpload *velerov2alpha1api.DataUpload)) error
func UpdatePVBStatusToFailed ¶ added in v1.9.6
func UpdatePVBStatusToFailed(ctx context.Context, c client.Client, pvb *velerov1api.PodVolumeBackup, errOut error, msg string, time time.Time, log logrus.FieldLogger) error
func UpdatePVRStatusToFailed ¶ added in v1.9.6
func UpdatePVRStatusToFailed(ctx context.Context, c client.Client, pvb *velerov1api.PodVolumeRestore, errString string, time time.Time, log logrus.FieldLogger) error
Types ¶
type BackupRepoReconciler ¶ added in v1.10.0
func NewBackupRepoReconciler ¶ added in v1.10.0
func NewBackupRepoReconciler(namespace string, logger logrus.FieldLogger, client client.Client, maintenanceFrequency time.Duration, repositoryManager repository.Manager) *BackupRepoReconciler
func (*BackupRepoReconciler) SetupWithManager ¶ added in v1.10.0
func (r *BackupRepoReconciler) SetupWithManager(mgr ctrl.Manager) error
type BackupTracker ¶ added in v0.8.0
type BackupTracker interface { // Add informs the tracker that a backup is in progress. Add(ns, name string) // Delete informs the tracker that a backup is no longer in progress. Delete(ns, name string) // Contains returns true if the tracker is tracking the backup. Contains(ns, name string) bool }
BackupTracker keeps track of in-progress backups.
func NewBackupTracker ¶ added in v0.8.0
func NewBackupTracker() BackupTracker
NewBackupTracker returns a new BackupTracker.
type DataDownloadReconciler ¶ added in v1.12.0
type DataDownloadReconciler struct { Clock clock.WithTickerAndDelayedExecution // contains filtered or unexported fields }
DataDownloadReconciler reconciles a DataDownload object
func NewDataDownloadReconciler ¶ added in v1.12.0
func NewDataDownloadReconciler(client client.Client, kubeClient kubernetes.Interface, dataPathMgr *datapath.Manager, repoEnsurer *repository.Ensurer, credentialGetter *credentials.CredentialGetter, nodeName string, preparingTimeout time.Duration, logger logrus.FieldLogger, metrics *metrics.ServerMetrics) *DataDownloadReconciler
func (*DataDownloadReconciler) AttemptDataDownloadResume ¶ added in v1.12.3
func (*DataDownloadReconciler) CancelAcceptedDataDownload ¶ added in v1.12.3
func (r *DataDownloadReconciler) CancelAcceptedDataDownload(ctx context.Context, cli client.Client, ns string)
CancelAcceptedDataDownload will cancel the accepted data download
func (*DataDownloadReconciler) FindDataDownloads ¶ added in v1.12.0
func (r *DataDownloadReconciler) FindDataDownloads(ctx context.Context, cli client.Client, ns string) ([]*velerov2alpha1api.DataDownload, error)
func (*DataDownloadReconciler) OnDataDownloadCancelled ¶ added in v1.12.0
func (r *DataDownloadReconciler) OnDataDownloadCancelled(ctx context.Context, namespace string, ddName string)
func (*DataDownloadReconciler) OnDataDownloadCompleted ¶ added in v1.12.0
func (*DataDownloadReconciler) OnDataDownloadFailed ¶ added in v1.12.0
func (*DataDownloadReconciler) OnDataDownloadProgress ¶ added in v1.12.0
func (*DataDownloadReconciler) SetupWithManager ¶ added in v1.12.0
func (r *DataDownloadReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the DataDownload controller. The fresh new DataDownload CR first created will trigger to create one pod (long time, maybe failure or unknown status) by one of the datadownload controllers then the request will get out of the Reconcile queue immediately by not blocking others' CR handling, in order to finish the rest data download process we need to re-enqueue the previous related request once the related pod is in running status to keep going on the rest logic. and below logic will avoid handling the unwanted pod status and also avoid block others CR handling
func (*DataDownloadReconciler) TryCancelDataDownload ¶ added in v1.12.0
func (r *DataDownloadReconciler) TryCancelDataDownload(ctx context.Context, dd *velerov2alpha1api.DataDownload, message string)
type DataUploadReconciler ¶ added in v1.12.0
type DataUploadReconciler struct { Clock clocks.WithTickerAndDelayedExecution // contains filtered or unexported fields }
DataUploadReconciler reconciles a DataUpload object
func NewDataUploadReconciler ¶ added in v1.12.0
func NewDataUploadReconciler(client client.Client, kubeClient kubernetes.Interface, csiSnapshotClient snapshotter.SnapshotV1Interface, dataPathMgr *datapath.Manager, loadAffinity *nodeagent.LoadAffinity, repoEnsurer *repository.Ensurer, clock clocks.WithTickerAndDelayedExecution, cred *credentials.CredentialGetter, nodeName string, fs filesystem.Interface, preparingTimeout time.Duration, log logrus.FieldLogger, metrics *metrics.ServerMetrics) *DataUploadReconciler
func (*DataUploadReconciler) AttemptDataUploadResume ¶ added in v1.12.3
func (*DataUploadReconciler) CancelAcceptedDataupload ¶ added in v1.12.3
func (*DataUploadReconciler) FindDataUploadsByPod ¶ added in v1.12.3
func (r *DataUploadReconciler) FindDataUploadsByPod(ctx context.Context, cli client.Client, ns string) ([]velerov2alpha1api.DataUpload, error)
func (*DataUploadReconciler) OnDataUploadCancelled ¶ added in v1.12.0
func (r *DataUploadReconciler) OnDataUploadCancelled(ctx context.Context, namespace string, duName string)
func (*DataUploadReconciler) OnDataUploadCompleted ¶ added in v1.12.0
func (*DataUploadReconciler) OnDataUploadFailed ¶ added in v1.12.0
func (r *DataUploadReconciler) OnDataUploadFailed(ctx context.Context, namespace, duName string, err error)
func (*DataUploadReconciler) OnDataUploadProgress ¶ added in v1.12.0
func (*DataUploadReconciler) SetupWithManager ¶ added in v1.12.0
func (r *DataUploadReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the DataUpload controller. The fresh new DataUpload CR first created will trigger to create one pod (long time, maybe failure or unknown status) by one of the dataupload controllers then the request will get out of the Reconcile queue immediately by not blocking others' CR handling, in order to finish the rest data upload process we need to re-enqueue the previous related request once the related pod is in running status to keep going on the rest logic. and below logic will avoid handling the unwanted pod status and also avoid block others CR handling
func (*DataUploadReconciler) TryCancelDataUpload ¶ added in v1.12.0
func (r *DataUploadReconciler) TryCancelDataUpload(ctx context.Context, du *velerov2alpha1api.DataUpload, message string)
TryCancelDataUpload clear up resources only when update success
type PluginLister ¶ added in v1.5.1
type PluginLister interface { // List returns all PluginIdentifiers for kind. List(kind common.PluginKind) []framework.PluginIdentifier }
type PodVolumeBackupReconciler ¶ added in v1.9.0
PodVolumeBackupReconciler reconciles a PodVolumeBackup object
func NewPodVolumeBackupReconciler ¶ added in v1.12.0
func NewPodVolumeBackupReconciler(client client.Client, dataPathMgr *datapath.Manager, ensurer *repository.Ensurer, credentialGetter *credentials.CredentialGetter, nodeName string, scheme *runtime.Scheme, metrics *metrics.ServerMetrics, logger logrus.FieldLogger) *PodVolumeBackupReconciler
NewPodVolumeBackupReconciler creates the PodVolumeBackupReconciler instance
func (*PodVolumeBackupReconciler) OnDataPathCancelled ¶ added in v1.12.0
func (r *PodVolumeBackupReconciler) OnDataPathCancelled(ctx context.Context, namespace string, pvbName string)
func (*PodVolumeBackupReconciler) OnDataPathCompleted ¶ added in v1.12.0
func (*PodVolumeBackupReconciler) OnDataPathFailed ¶ added in v1.12.0
func (r *PodVolumeBackupReconciler) OnDataPathFailed(ctx context.Context, namespace, pvbName string, err error)
func (*PodVolumeBackupReconciler) OnDataPathProgress ¶ added in v1.12.0
func (*PodVolumeBackupReconciler) SetupWithManager ¶ added in v1.9.0
func (r *PodVolumeBackupReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager registers the PVB controller.
type PodVolumeRestoreReconciler ¶ added in v1.9.0
func NewPodVolumeRestoreReconciler ¶ added in v1.9.0
func NewPodVolumeRestoreReconciler(client client.Client, dataPathMgr *datapath.Manager, ensurer *repository.Ensurer, credentialGetter *credentials.CredentialGetter, logger logrus.FieldLogger) *PodVolumeRestoreReconciler
func (*PodVolumeRestoreReconciler) OnDataPathCancelled ¶ added in v1.12.0
func (c *PodVolumeRestoreReconciler) OnDataPathCancelled(ctx context.Context, namespace string, pvrName string)
func (*PodVolumeRestoreReconciler) OnDataPathCompleted ¶ added in v1.12.0
func (*PodVolumeRestoreReconciler) OnDataPathFailed ¶ added in v1.12.0
func (*PodVolumeRestoreReconciler) OnDataPathProgress ¶ added in v1.12.0
func (*PodVolumeRestoreReconciler) SetupWithManager ¶ added in v1.9.0
func (c *PodVolumeRestoreReconciler) SetupWithManager(mgr ctrl.Manager) error
Source Files ¶
- backup_controller.go
- backup_deletion_controller.go
- backup_finalizer_controller.go
- backup_operations_controller.go
- backup_repository_controller.go
- backup_storage_location_controller.go
- backup_sync_controller.go
- backup_tracker.go
- constants.go
- data_download_controller.go
- data_upload_controller.go
- download_request_controller.go
- gc_controller.go
- interface.go
- pod_volume_backup_controller.go
- pod_volume_restore_controller.go
- restore_controller.go
- restore_finalizer_controller.go
- restore_operations_controller.go
- schedule_controller.go
- server_status_request_controller.go