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 GetActionSetByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.ActionSet, error)
- func GetBackupMethodsFromBackupPolicy(backupPolicyList *dpv1alpha1.BackupPolicyList, backupPolicyName string) (string, map[string]struct{}, error)
- func GetBackupVolumeSnapshotName(backupName, volumeSource string) string
- 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, backupPath string)
- func InjectDatasafedWithPVC(podSpec *corev1.PodSpec, pvcName string, mountPath string, backupPath string)
- func IsJobFinished(job *batchv1.Job) (bool, batchv1.JobConditionType, string)
- func MergeEnv(originalEnv, targetEnv []corev1.EnvVar) []corev1.EnvVar
- func RemoveDataProtectionFinalizer(ctx context.Context, cli client.Client, obj client.Object) error
- func SetControllerReference(owner, controlled metav1.Object, scheme *runtime.Scheme) error
- func VolumeSnapshotEnabled(ctx context.Context, cli client.Client, pod *corev1.Pod, volumes []string) (bool, 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 GetActionSetByName ¶
func GetActionSetByName(reqCtx intctrlutil.RequestCtx, cli client.Client, name string) (*dpv1alpha1.ActionSet, error)
GetActionSetByName gets the ActionSet by name.
func GetBackupMethodsFromBackupPolicy ¶
func GetBackupMethodsFromBackupPolicy(backupPolicyList *dpv1alpha1.BackupPolicyList, backupPolicyName string) (string, map[string]struct{}, error)
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 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, backupPath string)
func InjectDatasafedWithPVC ¶
func IsJobFinished ¶
func MergeEnv ¶
MergeEnv merges the targetEnv to original env. if original env exist the same name var, it will be replaced.
func SetControllerReference ¶
Types ¶
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
}