kubernetes

package
v0.5.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2022 License: Apache-2.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GWCMustBeAccepted

func GWCMustBeAccepted(t *testing.T, c client.Client, gwcName string, seconds int) string

GWCMustBeAccepted waits until the specified GatewayClass has an Accepted condition set to true. It also returns the ControllerName for the GatewayClass. This will cause the test to halt if the specified timeout is exceeded.

func GatewayAndHTTPRoutesMustBeReady

func GatewayAndHTTPRoutesMustBeReady(t *testing.T, c client.Client, controllerName string, gwNN types.NamespacedName, routeNNs ...types.NamespacedName) string

GatewayAndHTTPRoutesMustBeReady waits until the specified Gateway has an IP address assigned to it and the Route has a ParentRef referring to the Gateway. The test will fail if these conditions are not met before the timeouts.

func GatewayStatusMustHaveListeners

func GatewayStatusMustHaveListeners(t *testing.T, client client.Client, gwNN types.NamespacedName, listeners []v1alpha2.ListenerStatus, seconds int)

GatewayStatusMustHaveListeners waits for the specified Gateway to have listeners in status that match the expected listeners. This will cause the test to halt if the specified timeout is exceeded.

func HTTPRouteMustHaveNoAcceptedParents

func HTTPRouteMustHaveNoAcceptedParents(t *testing.T, client client.Client, routeName types.NamespacedName, seconds int)

HTTPRouteMustHaveNoAcceptedParents waits for the specified HTTPRoute to have either no parents or a single parent that is not accepted. This is used to validate HTTPRoute errors.

func HTTPRouteMustHaveParents

func HTTPRouteMustHaveParents(t *testing.T, client client.Client, routeName types.NamespacedName, parents []v1alpha2.RouteParentStatus, namespaceRequired bool, seconds int)

HTTPRouteMustHaveParents waits for the specified HTTPRoute to have parents in status that match the expected parents. This will cause the test to halt if the specified timeout is exceeded.

func MustCreateSelfSignedCertSecret

func MustCreateSelfSignedCertSecret(t *testing.T, namespace, secretName string, hosts []string) *corev1.Secret

MustCreateSelfSignedCertSecret creates a self-signed SSL certificate and stores it in a secret

func NamespacesMustBeReady

func NamespacesMustBeReady(t *testing.T, c client.Client, namespaces []string, seconds int)

NamespacesMustBeReady waits until all Pods and Gateways in the provided namespaces are marked as ready. This will cause the test to halt if the specified timeout is exceeded.

func WaitForGatewayAddress

func WaitForGatewayAddress(t *testing.T, client client.Client, gwName types.NamespacedName, seconds int) (string, error)

WaitForGatewayAddress waits until at least one IP Address has been set in the status of the specified Gateway.

Types

type Applier

type Applier struct {
	NamespaceLabels map[string]string
	// ValidUniqueListenerPorts maps each listener port of each Gateway in the
	// manifests to a valid, unique port. There must be as many
	// ValidUniqueListenerPorts as there are listeners in the set of manifests.
	// For example, given two Gateways, each with 2 listeners, there should be
	// four ValidUniqueListenerPorts.
	// If empty or nil, ports are not modified.
	ValidUniqueListenerPorts []v1alpha2.PortNumber
}

Applier prepares manifests depending on the available options and applies them to the Kubernetes cluster.

func (Applier) MustApplyObjectsWithCleanup

func (a Applier) MustApplyObjectsWithCleanup(t *testing.T, c client.Client, resources []client.Object, cleanup bool)

func (Applier) MustApplyWithCleanup

func (a Applier) MustApplyWithCleanup(t *testing.T, c client.Client, location string, gcName string, cleanup bool)

MustApplyWithCleanup creates or updates Kubernetes resources defined with the provided YAML file and registers a cleanup function for resources it created. Note that this does not remove resources that already existed in the cluster.

Jump to

Keyboard shortcuts

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