utils

package
v0.7.0-beta.2 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTolerations

func AddTolerations(podSpec *corev1.PodSpec) (err error)

func BuildEnvByCredential

func BuildEnvByCredential(pod *corev1.Pod, credential *dpv1alpha1.ConnectionCredential) []corev1.EnvVar

func GetActionSetByName

func GetActionSetByName(reqCtx intctrlutil.RequestCtx,
	cli client.Client, name string) (*dpv1alpha1.ActionSet, error)

GetActionSetByName gets the ActionSet by name.

func GetBackupVolumeSnapshotName

func GetBackupVolumeSnapshotName(backupName, volumeSource string) string

func GetPodListByLabelSelector

func GetPodListByLabelSelector(reqCtx intctrlutil.RequestCtx,
	cli client.Client,
	labelSelector metav1.LabelSelector) (*corev1.PodList, error)

func IsJobFinished

func IsJobFinished(job *batchv1.Job) (bool, batchv1.JobConditionType, string)

func MergeEnv

func MergeEnv(originalEnv, targetEnv []corev1.EnvVar) []corev1.EnvVar

MergeEnv merges the targetEnv to original env. if original env exist the same name var, it will be replaced.

func RemoveDataProtectionFinalizer

func RemoveDataProtectionFinalizer(ctx context.Context, cli client.Client, obj client.Object) error

func SetControllerReference

func SetControllerReference(owner, controlled metav1.Object, scheme *runtime.Scheme) error

func VolumeSnapshotEnabled

func VolumeSnapshotEnabled(ctx context.Context, cli client.Client, pod *corev1.Pod, volumes []string) (bool, error)

VolumeSnapshotEnabled checks if the volumes support snapshot.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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