lib

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2022 License: Apache-2.0 Imports: 56 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 AreRegistryDeploymentsAvailable

func AreRegistryDeploymentsAvailable(namespace string) wait.ConditionFunc

func AreRegistryDeploymentsNotAvailable

func AreRegistryDeploymentsNotAvailable(namespace string) wait.ConditionFunc

func AreResticPodsRunning

func AreResticPodsRunning(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) string

func CreateBackupForNamespaces

func CreateBackupForNamespaces(ocClient client.Client, veleroNamespace, backupName string, namespaces []string) (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 DoesBSLExist

check if bsl matches the spec

func DoesCustomPluginExist

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

func DoesDaemonSetExists

func DoesDaemonSetExists(namespace string, resticName string) 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 DoesVSLExist

check if vsl matches the spec

func DoesVeleroDeploymentExist

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

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 GetSecretRef

func GetSecretRef(credSecretRef string) string

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 GetVeleroPods

func GetVeleroPods(namespace string) (*corev1.PodList, 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 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) string

func RunMustGather

func RunMustGather(oc_cli string, artifact_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) error

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"
	RESTIC BackupRestoreType = "restic"
)

type DpaCustomResource

type DpaCustomResource struct {
	Name       string
	Namespace  string
	SecretName string

	CustomResource *oadpv1alpha1.DataProtectionApplication
	Client         client.Client
	Credentials    string
	CredSecretRef  string
	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) 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

Jump to

Keyboard shortcuts

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