Documentation
¶
Overview ¶
Package funcs contains convenience functions for working with e2e-framework environments and feature tests.
Index ¶
- func AddCrossplaneTypesToScheme() env.Func
- func AllOf(fns ...features.Func) features.Func
- func ApplyHandler(r *resources.Resources, manager string) decoder.HandlerFunc
- func ApplyResources(manager, dir, pattern string) features.Func
- func AsFeaturesFunc(fn env.Func) features.Func
- func CRDInitialNamesAccepted() xpv1.Condition
- func CopyImageToRegistry(clusterName, ns, sName, image string, timeout time.Duration) features.Func
- func CreateKindClusterWithConfig(clusterName, configFilePath string) env.Func
- func DeleteResources(dir, pattern string) features.Func
- func DeploymentBecomesAvailableWithin(d time.Duration, namespace, name string) features.Func
- func EnvFuncs(fns ...env.Func) env.Func
- func FilterByGK(gk schema.GroupKind) func(o k8s.Object) bool
- func HelmInstall(o ...helm.Option) env.Func
- func HelmRepo(o ...helm.Option) env.Func
- func HelmUninstall(o ...helm.Option) env.Func
- func HelmUpgrade(o ...helm.Option) env.Func
- func ManagedResourcesOfClaimHaveFieldValueWithin(d time.Duration, dir, file, path string, want any, ...) features.Func
- func ReadyToTestWithin(d time.Duration, namespace string) features.Func
- func ResourceCreatedWithin(d time.Duration, o k8s.Object) features.Func
- func ResourceDeletedWithin(d time.Duration, o k8s.Object) features.Func
- func ResourceHasFieldValueWithin(d time.Duration, o k8s.Object, path string, want any) features.Func
- func ResourcesCreatedWithin(d time.Duration, dir, pattern string) features.Func
- func ResourcesDeletedWithin(d time.Duration, dir, pattern string) features.Func
- func ResourcesFailToApply(manager, dir, pattern string) features.Func
- func ResourcesHaveConditionWithin(d time.Duration, dir, pattern string, cds ...xpv1.Condition) features.Func
- func ResourcesHaveFieldValueWithin(d time.Duration, dir, pattern, path string, want any) features.Func
- func ServiceIngressEndPoint(ctx context.Context, cfg *envconf.Config, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCrossplaneTypesToScheme ¶
AddCrossplaneTypesToScheme adds Crossplane's core custom resource's to the environment's scheme. This allows the environment's client to work with said types.
func ApplyHandler ¶
func ApplyHandler(r *resources.Resources, manager string) decoder.HandlerFunc
ApplyHandler is a decoder.Handler that uses server-side apply to apply the supplied object.
func ApplyResources ¶
ApplyResources applies all manifests under the supplied directory that match the supplied glob pattern (e.g. *.yaml). It uses server-side apply - fields are managed by the supplied field manager. It fails the test if any supplied resource cannot be applied successfully.
func AsFeaturesFunc ¶
AsFeaturesFunc converts an env.Func to a features.Func. If the env.Func returns an error the calling test is failed with t.Fatal(err).
func CRDInitialNamesAccepted ¶
CRDInitialNamesAccepted is the status condition CRDs emit when they're established. Most of our Crossplane status conditions are defined elsewhere (e.g. in the xpv1 package), but this isn't so we define it here for convenience.
func CopyImageToRegistry ¶
CopyImageToRegistry tries to copy the supplied image to the supplied registry within the timeout
func CreateKindClusterWithConfig ¶
CreateKindClusterWithConfig create kind cluster of the given name according to configuration referred via configFilePath. The configuration is placed in test context afterward
func DeleteResources ¶
DeleteResources deletes (from the environment) all resources defined by the manifests under the supplied directory that match the supplied glob pattern (e.g. *.yaml).
func DeploymentBecomesAvailableWithin ¶
DeploymentBecomesAvailableWithin fails a test if the supplied Deployment is not Available within the supplied duration.
func FilterByGK ¶
FilterByGK returns a filter function that returns true if the supplied object is of the supplied GroupKind.
func HelmUninstall ¶
HelmUninstall uninstalls a Helm chart.
func ManagedResourcesOfClaimHaveFieldValueWithin ¶
func ManagedResourcesOfClaimHaveFieldValueWithin(d time.Duration, dir, file, path string, want any, filter func(object k8s.Object) bool) features.Func
ManagedResourcesOfClaimHaveFieldValueWithin fails a test if the managed resources created by the claim does not have the supplied value at the supplied path within the supplied duration.
func ReadyToTestWithin ¶
ReadyToTestWithin fails a test if Crossplane is not ready to test within the supplied duration. It's typically called in a feature's Setup function. Its purpose isn't to test that Crossplane installed successfully (we have a specific test for that). Instead its purpose is to make sure tests don't start before Crossplane has finished installing.
func ResourceCreatedWithin ¶
ResourceCreatedWithin fails a test if the supplied resource is not found to exist within the supplied duration.
func ResourceDeletedWithin ¶
ResourceDeletedWithin fails a test if the supplied resource is not deleted within the supplied duration.
func ResourceHasFieldValueWithin ¶
func ResourceHasFieldValueWithin(d time.Duration, o k8s.Object, path string, want any) features.Func
ResourceHasFieldValueWithin fails a test if the supplied resource does not have the supplied value at the supplied field path within the supplied duration. The supplied 'want' value must cmp.Equal the actual value.
func ResourcesCreatedWithin ¶
ResourcesCreatedWithin fails a test if the supplied resources are not found to exist within the supplied duration.
func ResourcesDeletedWithin ¶
ResourcesDeletedWithin fails a test if the supplied resources are not deleted within the supplied duration.
func ResourcesFailToApply ¶
ResourcesFailToApply applies all manifests under the supplied directory that match the supplied glob pattern (e.g. *.yaml). It uses server-side apply - fields are managed by the supplied field manager. It fails the test if any supplied resource _can_ be applied successfully - use it to test that the API server should reject a resource.
func ResourcesHaveConditionWithin ¶
func ResourcesHaveConditionWithin(d time.Duration, dir, pattern string, cds ...xpv1.Condition) features.Func
ResourcesHaveConditionWithin fails a test if the supplied resources do not have (i.e. become) the supplied conditions within the supplied duration.
func ResourcesHaveFieldValueWithin ¶
func ResourcesHaveFieldValueWithin(d time.Duration, dir, pattern, path string, want any) features.Func
ResourcesHaveFieldValueWithin fails a test if the supplied resources do not have the supplied value at the supplied field path within the supplied duration. The supplied 'want' value must cmp.Equal the actual value.
Types ¶
This section is empty.