dataprotection

package
v0.8.4-beta.10 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: AGPL-3.0 Imports: 62 Imported by: 1

Documentation

Index

Constants

View Source
const (
	// condition types
	ConditionTypeStorageProviderReady  = "StorageProviderReady"
	ConditionTypeParametersChecked     = "ParametersChecked"
	ConditionTypeStorageClassCreated   = "StorageClassCreated"
	ConditionTypePVCTemplateChecked    = "PVCTemplateChecked"
	ConditionTypeDerivedObjectsDeleted = "DerivedObjectsDeleted"
	ConditionTypePreCheckPassed        = "PreCheckPassed"

	// condition reasons
	ReasonStorageProviderReady      = "StorageProviderReady"
	ReasonStorageProviderNotReady   = "StorageProviderNotReady"
	ReasonStorageProviderNotFound   = "StorageProviderNotFound"
	ReasonInvalidStorageProvider    = "InvalidStorageProvider"
	ReasonParametersChecked         = "ParametersChecked"
	ReasonCredentialSecretNotFound  = "CredentialSecretNotFound"
	ReasonPrepareCSISecretFailed    = "PrepareCSISecretFailed"
	ReasonPrepareStorageClassFailed = "PrepareStorageClassFailed"
	ReasonBadPVCTemplate            = "BadPVCTemplate"
	ReasonStorageClassCreated       = "StorageClassCreated"
	ReasonPVCTemplateChecked        = "PVCTemplateChecked"
	ReasonHaveAssociatedBackups     = "HaveAssociatedBackups"
	ReasonHaveResidualPVCs          = "HaveResidualPVCs"
	ReasonDerivedObjectsDeleted     = "DerivedObjectsDeleted"
	ReasonPreCheckPassed            = "PreCheckPassed"
	ReasonPreCheckFailed            = "PreCheckFailed"
	ReasonDigestChanged             = "DigestChanged"
	ReasonUnknownError              = "UnknownError"
	ReasonSkipped                   = "Skipped"
)

condition constants

View Source
const (
	PopulatePodPrefix = "kb-populate"

	// annotation keys
	AnnSelectedNode = "volume.kubernetes.io/selected-node"
	AnnPopulateFrom = "dataprotection.kubeblocks.io/populate-from"

	// event reason
	ReasonStartToVolumePopulate = "StartToVolumePopulate"
	ReasonVolumePopulateSucceed = "VolumePopulateSucceed"
	ReasonVolumePopulateFailed  = "VolumePopulateFailed"

	// pvc condition type and reason
	ReasonPopulatingFailed     = "Failed"
	ReasonPopulatingProcessing = "Processing"
	ReasonPopulatingSucceed    = "Succeed"

	PersistentVolumeClaimPopulating corev1.PersistentVolumeClaimConditionType = "Populating"
)

constant for volume populator

Variables

This section is empty.

Functions

func GetTargetPods added in v0.7.1

func GetTargetPods(reqCtx intctrlutil.RequestCtx,
	cli client.Client, podName string,
	backupMethod *dpv1alpha1.BackupMethod,
	backupPolicy *dpv1alpha1.BackupPolicy,
) ([]*corev1.Pod, error)

GetTargetPods gets the target pods by BackupPolicy. If podName is not empty, it will return the pod which name is podName. Otherwise, it will return the pods which are selected by BackupPolicy selector and strategy.

func HandleBackupRepo added in v0.7.1

func HandleBackupRepo(request *dpbackup.Request) error

func PatchBackupObjectMeta added in v0.7.1

func PatchBackupObjectMeta(
	original *dpv1alpha1.Backup,
	request *dpbackup.Request) (bool, error)

PatchBackupObjectMeta patches backup object metaObject include cluster snapshot.

func RecorderEventAndRequeue added in v0.7.1

func RecorderEventAndRequeue(reqCtx intctrlutil.RequestCtx, recorder record.EventRecorder,
	obj client.Object, err error) (reconcile.Result, error)

Types

type ActionSetReconciler added in v0.7.0

type ActionSetReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

ActionSetReconciler reconciles a ActionSet object

func (*ActionSetReconciler) Reconcile added in v0.7.0

func (r *ActionSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the actionset closer to the desired state.

func (*ActionSetReconciler) SetupWithManager added in v0.7.0

func (r *ActionSetReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BackupPolicyReconciler

type BackupPolicyReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

BackupPolicyReconciler reconciles a BackupPolicy object

func (*BackupPolicyReconciler) Reconcile

func (r *BackupPolicyReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backuppolicy closer to the desired state.

func (*BackupPolicyReconciler) SetupWithManager

func (r *BackupPolicyReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BackupReconciler

type BackupReconciler struct {
	client.Client
	Scheme     *k8sruntime.Scheme
	Recorder   record.EventRecorder
	RestConfig *rest.Config
	// contains filtered or unexported fields
}

BackupReconciler reconciles a Backup object

func (*BackupReconciler) Reconcile

func (r *BackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backup closer to the desired state.

func (*BackupReconciler) SetupWithManager

func (r *BackupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BackupRepoReconciler added in v0.6.0

type BackupRepoReconciler struct {
	client.Client
	Scheme     *runtime.Scheme
	Recorder   record.EventRecorder
	RestConfig *rest.Config
	// contains filtered or unexported fields
}

BackupRepoReconciler reconciles a BackupRepo object

func (*BackupRepoReconciler) Reconcile added in v0.6.0

func (r *BackupRepoReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.14.1/pkg/reconcile

func (*BackupRepoReconciler) SetupWithManager added in v0.6.0

func (r *BackupRepoReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type BackupScheduleReconciler added in v0.7.0

type BackupScheduleReconciler struct {
	client.Client
	Scheme   *k8sruntime.Scheme
	Recorder record.EventRecorder
}

BackupScheduleReconciler reconciles a BackupSchedule object

func (*BackupScheduleReconciler) Reconcile added in v0.7.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backupschedule closer to the desired state.

func (*BackupScheduleReconciler) SetupWithManager added in v0.7.0

func (r *BackupScheduleReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type GCReconciler added in v0.7.0

type GCReconciler struct {
	client.Client
	Recorder record.EventRecorder
	// contains filtered or unexported fields
}

GCReconciler garbage collection reconciler, which periodically deletes expired backups.

func NewGCReconciler added in v0.7.0

func NewGCReconciler(mgr ctrl.Manager) *GCReconciler

func (*GCReconciler) Reconcile added in v0.7.0

func (r *GCReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to delete expired backups.

func (*GCReconciler) SetupWithManager added in v0.7.0

func (r *GCReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the GCReconciler using the supplied manager. GCController only watches on CreateEvent for ensuring every new backup will be taken care of. Other events will be filtered to decrease the load on the controller.

type LogCollectionReconciler added in v0.8.2

type LogCollectionReconciler struct {
	client.Client
	Scheme     *k8sruntime.Scheme
	Recorder   record.EventRecorder
	RestConfig *rest.Config
}

LogCollectionReconciler reconciles a job of the backup and restore to collect the failed message.

func (*LogCollectionReconciler) Reconcile added in v0.8.2

func (r *LogCollectionReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the backup closer to the desired state.

func (*LogCollectionReconciler) SetupWithManager added in v0.8.2

func (r *LogCollectionReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type RestoreReconciler added in v0.7.0

type RestoreReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

RestoreReconciler reconciles a Restore object

func (*RestoreReconciler) HandleRestoreActions added in v0.7.1

func (r *RestoreReconciler) HandleRestoreActions(reqCtx intctrlutil.RequestCtx, restoreMgr *dprestore.RestoreManager) error

func (*RestoreReconciler) Reconcile added in v0.7.0

func (r *RestoreReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*RestoreReconciler) SetupWithManager added in v0.7.0

func (r *RestoreReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type VolumePopulatorReconciler added in v0.7.0

type VolumePopulatorReconciler struct {
	client.Client
	Scheme   *runtime.Scheme
	Recorder record.EventRecorder
}

VolumePopulatorReconciler reconciles a Restore object

func (*VolumePopulatorReconciler) Cleanup added in v0.7.1

func (*VolumePopulatorReconciler) ContainPopulatingCondition added in v0.7.1

func (r *VolumePopulatorReconciler) ContainPopulatingCondition(pvc *corev1.PersistentVolumeClaim) bool

func (*VolumePopulatorReconciler) MatchToPopulate added in v0.7.1

func (r *VolumePopulatorReconciler) MatchToPopulate(pvc *corev1.PersistentVolumeClaim) (bool, error)

func (*VolumePopulatorReconciler) Populate added in v0.7.1

func (*VolumePopulatorReconciler) Reconcile added in v0.7.0

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.0/pkg/reconcile

func (*VolumePopulatorReconciler) SetupWithManager added in v0.7.0

func (r *VolumePopulatorReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

func (*VolumePopulatorReconciler) UpdatePVCConditions added in v0.7.1

func (r *VolumePopulatorReconciler) UpdatePVCConditions(reqCtx intctrlutil.RequestCtx, pvc *corev1.PersistentVolumeClaim, reason, message string) error

Jump to

Keyboard shortcuts

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