Documentation ¶
Index ¶
- func AddTolerations(podSpec *corev1.PodSpec) (err error)
- func BuildEnvByCredential(pod *corev1.Pod, credential *dpv1alpha1.ConnectionCredential) []corev1.EnvVar
- func CovertEnvToMap(env []corev1.EnvVar) map[string]string
- func EventsToString(events *corev1.EventList) string
- func ExistTargetVolume(targetVolumes *dpv1alpha1.TargetVolumeInfo, volumeName string) bool
- func GetActionSetByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.ActionSet, error)
- func GetAssociatedPodsOfJob(ctx context.Context, cli client.Client, namespace, jobName string, ...) (*corev1.PodList, error)
- func GetBackupMethodByName(name string, backupPolicy *dpv1alpha1.BackupPolicy) *dpv1alpha1.BackupMethod
- func GetBackupMethodsFromBackupPolicy(backupPolicyList *dpv1alpha1.BackupPolicyList, backupPolicyName string) (string, map[string]struct{})
- func GetBackupPolicyByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.BackupPolicy, error)
- func GetBackupStatusTarget(backupObj *dpv1alpha1.Backup, sourceTargetName string) *dpv1alpha1.BackupStatusTarget
- func GetBackupTargets(backupPolicy *dpv1alpha1.BackupPolicy, backupMethod *dpv1alpha1.BackupMethod) []dpv1alpha1.BackupTarget
- func GetBackupType(actionSet *dpv1alpha1.ActionSet, useSnapshot *bool) dpv1alpha1.BackupType
- func GetBackupVolumeSnapshotName(backupName, volumeSource string, index int) string
- func GetFirstIndexRunningPod(podList *corev1.PodList) *corev1.Pod
- func GetKubeVersion() (string, error)
- func GetOldBackupVolumeSnapshotName(backupName, volumeSource string) string
- func GetPodByName(podList *corev1.PodList, name string) *corev1.Pod
- func GetPodFirstContainerPort(pod *corev1.Pod) int32
- func GetPodListByLabelSelector(reqCtx intctrlutil.RequestCtx, cli client.Client, ...) (*corev1.PodList, error)
- func InjectDatasafed(podSpec *corev1.PodSpec, repo *dpv1alpha1.BackupRepo, ...)
- func InjectDatasafedWithConfig(podSpec *corev1.PodSpec, configSecretName string, kopiaRepoPath string)
- func InjectDatasafedWithPVC(podSpec *corev1.PodSpec, pvcName string, mountPath string, ...)
- func IsJobFinished(job *batchv1.Job) (bool, batchv1.JobConditionType, string)
- func IsVolumeSnapshotEnabled(ctx context.Context, cli client.Client, pvName string) (bool, error)
- func MergeEnv(originalEnv, targetEnv []corev1.EnvVar) []corev1.EnvVar
- func PrependSpaces(content string, spaces int) string
- func RemoveDataProtectionFinalizer(ctx context.Context, cli client.Client, obj client.Object) error
- func SetControllerReference(owner, controlled metav1.Object, scheme *runtime.Scheme) error
- func SupportsCronJobV1() bool
- func SupportsVolumeSnapshotV1() bool
- func VolumeSnapshotEnabled(ctx context.Context, cli client.Client, pod *corev1.Pod, volumes []string) (bool, error)
- type CompatClient
- func (c *CompatClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (c *CompatClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (c *CompatClient) Get(ctx context.Context, key client.ObjectKey, obj client.Object, ...) error
- func (c *CompatClient) List(ctx context.Context, objList client.ObjectList, opts ...client.ListOption) error
- func (c *CompatClient) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- type PeriodicalEnqueueSource
- type PeriodicalEnqueueSourceOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTolerations ¶
func BuildEnvByCredential ¶
func BuildEnvByCredential(pod *corev1.Pod, credential *dpv1alpha1.ConnectionCredential) []corev1.EnvVar
func CovertEnvToMap ¶
CovertEnvToMap coverts env array to map.
func EventsToString ¶ added in v0.8.0
func ExistTargetVolume ¶ added in v0.8.3
func ExistTargetVolume(targetVolumes *dpv1alpha1.TargetVolumeInfo, volumeName string) bool
ExistTargetVolume checks if the backup.status.backupMethod.targetVolumes exists the target volume which should be restored.
func GetActionSetByName ¶
func GetActionSetByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.ActionSet, error)
GetActionSetByName gets the ActionSet by name.
func GetAssociatedPodsOfJob ¶ added in v0.8.0
func GetBackupMethodByName ¶ added in v0.7.1
func GetBackupMethodByName(name string, backupPolicy *dpv1alpha1.BackupPolicy) *dpv1alpha1.BackupMethod
func GetBackupMethodsFromBackupPolicy ¶
func GetBackupMethodsFromBackupPolicy(backupPolicyList *dpv1alpha1.BackupPolicyList, backupPolicyName string) (string, map[string]struct{})
GetBackupMethodsFromBackupPolicy get backup methods from backup policy if backup policy is specified, search the backup policy with the name if backup policy is not specified, search the default backup policy if method's snapshotVolumes is true, use the method as the default backup method
func GetBackupPolicyByName ¶ added in v0.7.1
func GetBackupPolicyByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.BackupPolicy, error)
func GetBackupStatusTarget ¶ added in v0.9.0
func GetBackupStatusTarget(backupObj *dpv1alpha1.Backup, sourceTargetName string) *dpv1alpha1.BackupStatusTarget
func GetBackupTargets ¶ added in v0.9.0
func GetBackupTargets(backupPolicy *dpv1alpha1.BackupPolicy, backupMethod *dpv1alpha1.BackupMethod) []dpv1alpha1.BackupTarget
GetBackupTargets gets the backup targets by 'backupMethod' and 'backupPolicy'. 'backupMethod' has a higher priority than the global targets in 'backupPolicy'.
func GetBackupType ¶
func GetBackupType(actionSet *dpv1alpha1.ActionSet, useSnapshot *bool) dpv1alpha1.BackupType
func GetFirstIndexRunningPod ¶ added in v0.7.2
GetFirstIndexRunningPod gets the first running pod with index.
func GetKubeVersion ¶ added in v0.7.2
GetKubeVersion get the version of Kubernetes and return the gitVersion
func GetOldBackupVolumeSnapshotName ¶ added in v0.9.0
func GetPodByName ¶ added in v0.9.1
func GetPodFirstContainerPort ¶ added in v0.8.2
func GetPodListByLabelSelector ¶
func GetPodListByLabelSelector(reqCtx intctrlutil.RequestCtx, cli client.Client, labelSelector *metav1.LabelSelector) (*corev1.PodList, error)
func InjectDatasafed ¶
func InjectDatasafed(podSpec *corev1.PodSpec, repo *dpv1alpha1.BackupRepo, repoVolumeMountPath string, encryptionConfig *dpv1alpha1.EncryptionConfig, kopiaRepoPath string)
func InjectDatasafedWithPVC ¶
func IsJobFinished ¶
IsJobFinished if the job is completed or failed, return true. if the job is failed, return the failed message.
func IsVolumeSnapshotEnabled ¶ added in v0.9.0
IsVolumeSnapshotEnabled checks if the CSI supports the volume snapshot.
func MergeEnv ¶
MergeEnv merges the targetEnv to original env. if original env exist the same name var, it will be replaced.
func PrependSpaces ¶ added in v0.8.0
PrependSpaces prepends spaces to each line of the content.
func SetControllerReference ¶
func SupportsCronJobV1 ¶ added in v0.8.2
func SupportsCronJobV1() bool
func SupportsVolumeSnapshotV1 ¶ added in v0.9.0
func SupportsVolumeSnapshotV1() bool
Types ¶
type CompatClient ¶ added in v0.9.0
CompatClient is compatible with VolumeSnapshot v1 and v1beta1, and CronJob v1 and v1beta1.
func NewCompatClient ¶ added in v0.9.0
func NewCompatClient(cli client.Client) *CompatClient
func (*CompatClient) Create ¶ added in v0.9.0
func (c *CompatClient) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
func (*CompatClient) Delete ¶ added in v0.9.0
func (c *CompatClient) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
func (*CompatClient) List ¶ added in v0.9.0
func (c *CompatClient) List(ctx context.Context, objList client.ObjectList, opts ...client.ListOption) error
type PeriodicalEnqueueSource ¶
PeriodicalEnqueueSource is an implementation of interface sigs.k8s.io/controller-runtime/pkg/source/Source It reads the specific resources from cache and enqueue them into the queue to trigger the reconcile procedure periodically.
func NewPeriodicalEnqueueSource ¶
func NewPeriodicalEnqueueSource( client client.Client, objList client.ObjectList, period time.Duration, option PeriodicalEnqueueSourceOption) *PeriodicalEnqueueSource
func (*PeriodicalEnqueueSource) Start ¶
func (p *PeriodicalEnqueueSource) Start( ctx context.Context, _ handler.EventHandler, q workqueue.RateLimitingInterface, predicates ...predicate.Predicate) error
func (*PeriodicalEnqueueSource) String ¶
func (p *PeriodicalEnqueueSource) String() string
type PeriodicalEnqueueSourceOption ¶
type PeriodicalEnqueueSourceOption struct {
OrderFunc func(objList client.ObjectList) client.ObjectList
}