applicationsets

package
v2.10.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Actions

type Actions struct {
	// contains filtered or unexported fields
}

this implements the "when" part of given/when/then

none of the func implement error checks, and that is complete intended, you should check for errors using the Then()

func (*Actions) And

func (a *Actions) And(block func()) *Actions

func (*Actions) AppSet added in v2.9.0

func (a *Actions) AppSet(appName string, flags ...string) *Actions

func (*Actions) Create

func (a *Actions) Create(appSet v1alpha1.ApplicationSet) *Actions

Create creates an ApplicationSet using the provided value

func (*Actions) CreateClusterSecret

func (a *Actions) CreateClusterSecret(secretName string, clusterName string, clusterServer string) *Actions

CreateClusterSecret creates a faux cluster secret, with the given cluster server and cluster name (this cluster will not actually be used by the Argo CD controller, but that's not needed for our E2E tests)

func (*Actions) CreateNamespace

func (a *Actions) CreateNamespace(namespace string) *Actions

Create a temporary namespace, from utils.ApplicationSet, for use by the test. This namespace will be deleted on subsequent tests.

func (*Actions) CreatePlacementDecision

func (a *Actions) CreatePlacementDecision(placementDecisionName string) *Actions

func (*Actions) CreatePlacementDecisionConfigMap

func (a *Actions) CreatePlacementDecisionConfigMap(configMapName string) *Actions

Create a ConfigMap for the ClusterResourceList generator

func (*Actions) CreatePlacementRoleAndRoleBinding

func (a *Actions) CreatePlacementRoleAndRoleBinding() *Actions

Create Role/RoleBinding to allow ApplicationSet to list the PlacementDecisions

func (*Actions) Delete

func (a *Actions) Delete() *Actions

Delete deletes the ApplicationSet within the context

func (*Actions) DeleteClusterSecret

func (a *Actions) DeleteClusterSecret(secretName string) *Actions

DeleteClusterSecret deletes a faux cluster secret

func (*Actions) DeleteConfigMap

func (a *Actions) DeleteConfigMap(configMapName string) *Actions

DeleteConfigMap deletes a faux cluster secret

func (*Actions) DeletePlacementDecision

func (a *Actions) DeletePlacementDecision(placementDecisionName string) *Actions

DeletePlacementDecision deletes a faux cluster secret

func (*Actions) DoNotIgnoreErrors

func (a *Actions) DoNotIgnoreErrors() *Actions

func (*Actions) IgnoreErrors

func (a *Actions) IgnoreErrors() *Actions

IgnoreErrors sets whether to ignore

func (*Actions) StatusUpdatePlacementDecision

func (a *Actions) StatusUpdatePlacementDecision(placementDecisionName string, clusterList []interface{}) *Actions

func (*Actions) SwitchToArgoCDNamespace added in v2.8.0

func (a *Actions) SwitchToArgoCDNamespace() *Actions

func (*Actions) SwitchToExternalNamespace added in v2.8.0

func (a *Actions) SwitchToExternalNamespace(namespace utils.ExternalNamespace) *Actions

func (*Actions) Then

func (a *Actions) Then() *Consequences

func (*Actions) Update

func (a *Actions) Update(toUpdate func(*v1alpha1.ApplicationSet)) *Actions

Update retrieves the latest copy the ApplicationSet, then allows the caller to mutate it via 'toUpdate', with the result applied back to the cluster resource

type Consequences

type Consequences struct {
	// contains filtered or unexported fields
}

this implements the "then" part of given/when/then

func (*Consequences) And

func (c *Consequences) And(block func()) *Consequences

func (*Consequences) Expect

func (c *Consequences) Expect(e Expectation) *Consequences

func (*Consequences) ExpectWithDuration

func (c *Consequences) ExpectWithDuration(e Expectation, timeout time.Duration) *Consequences

func (*Consequences) Given

func (c *Consequences) Given() *Context

func (*Consequences) When

func (c *Consequences) When() *Actions

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context implements the "given" part of given/when/then

func Given

func Given(t *testing.T) *Context

func (*Context) And

func (c *Context) And(block func()) *Context

func (*Context) Sleep

func (c *Context) Sleep(seconds time.Duration) *Context

func (*Context) When

func (c *Context) When() *Actions

type Expectation

type Expectation func(c *Consequences) (state state, message string)

Expectation returns succeeded on succes condition, or pending/failed on failure, along with a message to describe the success/failure condition.

func ApplicationSetHasConditions

func ApplicationSetHasConditions(applicationSetName string, expectedConditions []v1alpha1.ApplicationSetCondition) Expectation

ApplicationSetHasConditions checks whether each of the 'expectedConditions' exist in the ApplicationSet status, and are equivalent to provided values.

func ApplicationsDoNotExist

func ApplicationsDoNotExist(expectedApps []v1alpha1.Application) Expectation

ApplicationsDoNotExist checks that each of the 'expectedApps' no longer exist in the namespace

func ApplicationsExist

func ApplicationsExist(expectedApps []v1alpha1.Application) Expectation

ApplicationsExist checks whether each of the 'expectedApps' exist in the namespace, and are equivalent to provided values.

func Error

func Error(message, err string) Expectation

Error asserts that the last command was an error with substring match

func Pod

func Pod(predicate func(p corev1.Pod) bool) Expectation

Pod checks whether a specified condition is true for any of the pods in the namespace

func Success

func Success(message string) Expectation

Success asserts that the last command was successful

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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