util

package
v0.0.0-...-b80afe7 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package util provides common test utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteResource

func DeleteResource(clients client.Clients, namespace string, object *unstructured.Unstructured)

DeleteResource removes a resource from the system.

func DeleteResources

func DeleteResources(clients client.Clients, namespace string, objects []*unstructured.Unstructured)

DeleteResources removes resources from the system.

func Die

func Die(t *testing.T, err error)

Die provides useful debug information.

func MustCreateResource

func MustCreateResource(t *testing.T, clients client.Clients, namespace string, object *unstructured.Unstructured) *unstructured.Unstructured

MustCreateResource creates a Kubernetes resource.

func MustCreateResources

func MustCreateResources(t *testing.T, clients client.Clients, namespace string, objects []*unstructured.Unstructured)

MustCreateResources creates Kubernetes objects.

func MustFindResource

func MustFindResource(t *testing.T, objects []*unstructured.Unstructured, groupVersion, kind, name string) *unstructured.Unstructured

MustFindResource expects to find a specifc resource in a list of objects.

func MustGenerateServiceBrokerTLS

func MustGenerateServiceBrokerTLS(t *testing.T, namespace string) ([]byte, []byte, []byte)

MustGenerateServiceBrokerTLS returns TLS configuration for the service broker.

func MustGetNamespace

func MustGetNamespace(t *testing.T) *unstructured.Unstructured

MustGetNamespace creates a temporary, random namespace to use for testing in.

func MustReadYAMLObjects

func MustReadYAMLObjects(t *testing.T, path string) []*unstructured.Unstructured

MustReadYAMLObjects reads in a YAML file and unmarshals as unstructured objects.

func MustWaitFor

func MustWaitFor(t *testing.T, f util.WaitFunc, timeout time.Duration)

MustWaitFor waits until a condition is nil.

func ResourceCondition

func ResourceCondition(clients client.Clients, namespace string, object *unstructured.Unstructured, conditionType, conditionStatus string) func() error

ResourceCondition checks the resource for the specified condition.

func ResourceDeleted

func ResourceDeleted(clients client.Clients, namespace string, object *unstructured.Unstructured) func() error

ResourceDeleted checks whether a resource has need deleted and no longer exists.

func SetupCRDs

func SetupCRDs(clients client.Clients) error

setupCRDs deletes any CRDs we find that belong to our API group then creates any that are installed in the CRD directory installed in the container, the make file will ensure these are up to date.

func WaitFor

func WaitFor(f util.WaitFunc, timeout time.Duration) error

WaitFor waits until a condition is nil.

Types

This section is empty.

Jump to

Keyboard shortcuts

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