lib

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2023 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version struct representing OCP 4.8.x https://docs.openshift.com/container-platform/4.8/release_notes/ocp-4-8-release-notes.html
	K8sVersionOcp48 = K8sVersion{
		Major: "1",
		Minor: "21",
	}
	// https://docs.openshift.com/container-platform/4.7/release_notes/ocp-4-7-release-notes.html
	K8sVersionOcp47 = K8sVersion{
		Major: "1",
		Minor: "20",
	}
)
View Source
var VeleroPrefix = "velero-e2e-" + string(uuid.NewUUID())

Functions

func AreAppBuildsReady

func AreAppBuildsReady(ocClient client.Client, namespace string) wait.ConditionFunc

func AreApplicationPodsRunning

func AreApplicationPodsRunning(namespace string) wait.ConditionFunc

func AreNodeAgentPodsRunning added in v1.2.0

func AreNodeAgentPodsRunning(namespace string) wait.ConditionFunc

func AreRegistryDeploymentsAvailable

func AreRegistryDeploymentsAvailable(namespace string) wait.ConditionFunc

func AreRegistryDeploymentsNotAvailable

func AreRegistryDeploymentsNotAvailable(namespace string) wait.ConditionFunc

func AreVeleroPodsRunning

func AreVeleroPodsRunning(namespace string) wait.ConditionFunc

func AreVolumeSnapshotsReady

func AreVolumeSnapshotsReady(ocClient client.Client, backupName string) wait.ConditionFunc

func BackupErrorLogs

func BackupErrorLogs(ocClient client.Client, backup velero.Backup) []string

func BackupLogs

func BackupLogs(ocClient client.Client, backup velero.Backup) (backupLogs string)

func CreateBackupForNamespaces

func CreateBackupForNamespaces(ocClient client.Client, veleroNamespace, backupName string, namespaces []string, defaultVolumesToRestic bool) (velero.Backup, error)

func CreateCredentialsSecret

func CreateCredentialsSecret(data []byte, namespace string, credSecretRef string) error

func CreateRestoreFromBackup

func CreateRestoreFromBackup(ocClient client.Client, veleroNamespace, backupName, restoreName string, opts ...restoreOpts) (velero.Restore, error)

func DeleteSecret

func DeleteSecret(namespace string, credSecretRef string) error

func DoesBSLSpecMatchesDpa added in v1.1.0

func DoesBSLSpecMatchesDpa(namespace string, bsl velero.BackupStorageLocationSpec, spec *oadpv1alpha1.DataProtectionApplicationSpec) (bool, error)

check if bsl matches the spec

func DoesCustomPluginExist

func DoesCustomPluginExist(namespace string, plugin oadpv1alpha1.CustomPlugin) wait.ConditionFunc

func DoesNamespaceExist

func DoesNamespaceExist(namespace string) (bool, error)

FIXME: Remove

func DoesPluginExist

func DoesPluginExist(namespace string, plugin oadpv1alpha1.DefaultPlugin) wait.ConditionFunc

func DoesSCCExist

func DoesSCCExist(ocClient client.Client, sccName string) (bool, error)

func DoesVSLSpecMatchesDpa added in v1.1.0

func DoesVSLSpecMatchesDpa(namespace string, vslspec velero.VolumeSnapshotLocationSpec, spec *oadpv1alpha1.DataProtectionApplicationSpec) (bool, error)

check if vsl matches the spec

func DoesVeleroDeploymentExist

func DoesVeleroDeploymentExist(namespace string, deploymentName string) wait.ConditionFunc

func GetDeploymentPodContainerLogs added in v1.1.2

func GetDeploymentPodContainerLogs(namespace, deploymentName, containerName string) (string, error)

func GetOpenShiftADPLogs added in v1.0.5

func GetOpenShiftADPLogs(namespace string) (string, error)

func GetPodContainerLogs added in v1.0.5

func GetPodContainerLogs(namespace, podname, container string) (string, error)

func GetPodWithPrefixContainerLogs added in v1.0.5

func GetPodWithPrefixContainerLogs(namespace string, podPrefix string, container string) (string, error)

func GetRegistryDeploymentList

func GetRegistryDeploymentList(namespace string) (*appsv1.DeploymentList, error)

func GetResticDaemonsetList added in v1.1.0

func GetResticDaemonsetList(namespace string) (*appsv1.DaemonSetList, error)

func GetVeleroClient

func GetVeleroClient() (veleroClientset.Interface, error)

func GetVeleroContainerFailureLogs

func GetVeleroContainerFailureLogs(namespace string) []string

func GetVeleroContainerLogs added in v1.0.5

func GetVeleroContainerLogs(namespace string) (string, error)

Returns logs from velero container on velero pod

func GetVeleroDeploymentList added in v1.1.0

func GetVeleroDeploymentList(namespace string) (*appsv1.DeploymentList, error)

func GetVeleroPods

func GetVeleroPods(namespace string) (*corev1.PodList, error)

func GetVolumeSnapshotMoverLogs added in v1.2.0

func GetVolumeSnapshotMoverLogs(namespace string) (string, error)

func HasCorrectNumResticPods

func HasCorrectNumResticPods(namespace string) wait.ConditionFunc

func HasDCsInNamespace

func HasDCsInNamespace(ocClient client.Client, namespace string) (bool, error)

func HasReplicationControllersInNamespace

func HasReplicationControllersInNamespace(ocClient client.Client, namespace string) (bool, error)

func HasTemplateInstancesInNamespace

func HasTemplateInstancesInNamespace(ocClient client.Client, namespace string) (bool, error)

func InstallApplication

func InstallApplication(ocClient client.Client, file string) error

func InstallApplicationWithRetries added in v1.1.2

func InstallApplicationWithRetries(ocClient client.Client, file string, retries int) error

func InstalledSubscriptionCSV added in v1.1.2

func InstalledSubscriptionCSV(ocClient client.Client, namespace, subscriptionName string) func() (string, error)

func IsBackupCompletedSuccessfully

func IsBackupCompletedSuccessfully(ocClient client.Client, backup velero.Backup) (bool, error)

func IsBackupDone

func IsBackupDone(ocClient client.Client, veleroNamespace, name string) wait.ConditionFunc

func IsDCReady

func IsDCReady(ocClient client.Client, namespace, dcName string) wait.ConditionFunc

func IsDeploymentReady

func IsDeploymentReady(ocClient client.Client, namespace, dName string) wait.ConditionFunc

func IsNamespaceDeleted

func IsNamespaceDeleted(namespace string) wait.ConditionFunc

Keeping it for now.

func IsResticDaemonsetDeleted

func IsResticDaemonsetDeleted(namespace string) wait.ConditionFunc

keep for now

func IsRestoreCompletedSuccessfully

func IsRestoreCompletedSuccessfully(ocClient client.Client, veleroNamespace, name string) (bool, error)

func IsRestoreDone

func IsRestoreDone(ocClient client.Client, veleroNamespace, name string) wait.ConditionFunc

func LoadDpaSettingsFromJson

func LoadDpaSettingsFromJson(settings string) string

func NamespaceRequiresResticDCWorkaround

func NamespaceRequiresResticDCWorkaround(ocClient client.Client, namespace string) (bool, error)

func NotServerVersionTarget

func NotServerVersionTarget(minVersion *K8sVersion, maxVersion *K8sVersion) (bool, string)

func PrintNamespaceEventsAfterTime

func PrintNamespaceEventsAfterTime(namespace string, startTime time.Time)

func ResticDaemonSetHasNodeSelector

func ResticDaemonSetHasNodeSelector(namespace, key, value string) wait.ConditionFunc

func RestoreErrorLogs

func RestoreErrorLogs(ocClient client.Client, restore velero.Restore) []string

func RestoreLogs

func RestoreLogs(ocClient client.Client, restore velero.Restore) (restoreLogs string)

func RunMustGather

func RunMustGather(oc_cli string, artifact_dir string) error

func RunResticPostRestoreScript added in v1.1.0

func RunResticPostRestoreScript(dcRestoreName string) error

func SavePodLogs added in v1.2.0

func SavePodLogs(namespace, dir string) error

func UninstallApplication

func UninstallApplication(ocClient client.Client, file string) error

func VerifyBackupRestoreData

func VerifyBackupRestoreData(artifact_dir string, namespace string, routeName string, app string, prebackupState bool, twoVol bool, backupRestoretype BackupRestoreType) error

VerifyBackupRestoreData verifies if app ready before backup and after restore to compare data.

func VerifyVeleroResourceLimits

func VerifyVeleroResourceLimits(namespace string, limits corev1.ResourceList) wait.ConditionFunc

check for velero resource limits

func VerifyVeleroResourceRequests

func VerifyVeleroResourceRequests(namespace string, requests corev1.ResourceList) wait.ConditionFunc

check for velero resource requests

func VerifyVeleroTolerations

func VerifyVeleroTolerations(namespace string, t []corev1.Toleration) wait.ConditionFunc

check velero tolerations

func WithExcludedNamespaces

func WithExcludedNamespaces(namespaces []string) restoreOpts

func WithExcludedResources

func WithExcludedResources(resources []string) restoreOpts

func WithIncludedNamespaces

func WithIncludedNamespaces(namespaces []string) restoreOpts

func WithIncludedResources

func WithIncludedResources(resources []string) restoreOpts

Types

type BackupRestoreType

type BackupRestoreType string
const (
	CSI          BackupRestoreType = "csi"
	CSIDataMover BackupRestoreType = "csi-datamover"
	RESTIC       BackupRestoreType = "restic"
)

type DpaCustomResource

type DpaCustomResource struct {
	Name      string
	Namespace string

	CustomResource *oadpv1alpha1.DataProtectionApplication
	Client         client.Client
	Provider       string
	// contains filtered or unexported fields
}

func (*DpaCustomResource) Build

func (v *DpaCustomResource) Build(backupRestoreType BackupRestoreType) error

func (*DpaCustomResource) Create

func (v *DpaCustomResource) Create() error

func (*DpaCustomResource) CreateOrUpdate

func (*DpaCustomResource) CreateOrUpdateWithRetries

func (v *DpaCustomResource) CreateOrUpdateWithRetries(spec *oadpv1alpha1.DataProtectionApplicationSpec, retries int) error

func (*DpaCustomResource) Delete

func (v *DpaCustomResource) Delete() error

func (*DpaCustomResource) DisableRestic

func (v *DpaCustomResource) DisableRestic(namespace string, instanceName string) error

func (*DpaCustomResource) EnableResticNodeSelector

func (v *DpaCustomResource) EnableResticNodeSelector(namespace string, s3Bucket string, credSecretRef string, instanceName string) error

func (*DpaCustomResource) Get

func (*DpaCustomResource) GetNoErr

func (*DpaCustomResource) GetOperatorSubscription

func (d *DpaCustomResource) GetOperatorSubscription(stream string) (*Subscription, error)

func (*DpaCustomResource) IsDeleted

func (v *DpaCustomResource) IsDeleted() wait.ConditionFunc

func (*DpaCustomResource) ProviderStorageClassName added in v1.2.0

func (v *DpaCustomResource) ProviderStorageClassName(e2eRoot string) (string, error)

if e2e, test/e2e is "." since context is tests/e2e/ for unit-test, test/e2e is ".." since context is tests/e2e/lib/

func (*DpaCustomResource) RemoveVeleroPlugin

func (d *DpaCustomResource) RemoveVeleroPlugin(namespace string, instanceName string, pluginValues []oadpv1alpha1.DefaultPlugin, removedPlugin string) error

func (*DpaCustomResource) SetClient

func (v *DpaCustomResource) SetClient() error

type K8sVersion

type K8sVersion struct {
	Major string
	Minor string
}

type Subscription

type Subscription struct {
	*operators.Subscription
}

func (*Subscription) CreateOrUpdate

func (s *Subscription) CreateOrUpdate() error

func (*Subscription) CsvIsInstalling

func (s *Subscription) CsvIsInstalling() bool

func (*Subscription) CsvIsReady

func (s *Subscription) CsvIsReady() bool

func (*Subscription) Refresh added in v1.1.2

func (s *Subscription) Refresh() error

Jump to

Keyboard shortcuts

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