helper

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StandaloneArgoCDNamespace = "gitops-standalone-test"
)

Variables

This section is empty.

Functions

func ApplicationHealthStatus

func ApplicationHealthStatus(appname string, namespace string) error

ApplicationHealthStatus returns an error if the application is not 'Healthy'

func ApplicationSyncStatus

func ApplicationSyncStatus(appname string, namespace string) error

ApplicationSyncStatus returns an error if the application is not 'Synced'

func DeleteNamespace

func DeleteNamespace(k8sClient client.Client, nsToDelete string) error

DeleteNamespace deletes a namespace, and waits for deletion to complete.

func EnsureCleanSlate

func EnsureCleanSlate(k8sClient client.Client) error

EnsureCleanSlate runs before the tests, to ensure that the cluster is in the expected pre-test state

func ProjectExists

func ProjectExists(projectName string, namespace string) (bool, error)

ProjectExists return true if the AppProject exists in the namespace, false otherwise (with an error, if available).

func WaitForResourcesByName

func WaitForResourcesByName(k8sClient client.Client, resourceList []ResourceList, namespace string, timeout time.Duration) error

WaitForResourcesByName will wait up to 'timeout' minutes for a set of resources to exist; the resources should be of the given type (Deployment, Service, etc) and name(s). Returns error if the resources could not be found within the given time frame.

Types

type ResourceList

type ResourceList struct {
	// resource is the type of resource to verify that it exists
	Resource client.Object

	// expectedResources are the names of the resources of the above type
	ExpectedResources []string
}

ResourceList is used by waitForResourcesByName

Jump to

Keyboard shortcuts

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