testutil

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildMatchersFromExpected

func BuildMatchersFromExpected(ipLists []project.IPAccessList) []types.GomegaMatcher

func FindConditionByType

func FindConditionByType(conditions []status.Condition, conditionType status.ConditionType) (status.Condition, bool)

func MatchCondition

func MatchCondition(expected status.Condition) types.GomegaMatcher

MatchCondition returns the GomegaMatcher that checks if the 'actual' status.Condition matches the 'expected' one.

func MatchConditions

func MatchConditions(expected ...status.Condition) []types.GomegaMatcher

MatchConditions is a convenience method that allows to create the range of matchers simplifying testing

func MatchIPAccessList

func MatchIPAccessList(expected project.IPAccessList) types.GomegaMatcher

MatchIPAccessList returns the GomegaMatcher that checks if the 'actual' mongodbatlas.ProjectIPAccessList matches the 'expected' mdbv1.ProjectIPAccessList one. Note, that we cannot compare them by all the fields as Atlas tends to set default fields after IPAccessList creation so we need to compare only the fields that the Operator has set

func ReadAtlasResource

func ReadAtlasResource(k8sClient client.Client, createdResource mdbv1.AtlasCustomResource) bool

func WaitFor

func WaitFor(k8sClient client.Client, createdResource mdbv1.AtlasCustomResource, expectedCondition status.Condition, check ...func(mdbv1.AtlasCustomResource)) func() bool

WaitFor waits until the AO Custom Resource reaches some state - this is configured by 'expectedCondition'. It's possible to specify optional callbacks to check the state of the object if it hasn't reached the expected condition. This allows to validate the object in case it's in "pending" phase.

Types

This section is empty.

Jump to

Keyboard shortcuts

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