Documentation ¶
Index ¶
- func GWCMustBeAccepted(t *testing.T, c client.Client, gwcName string, seconds int) string
- func GatewayAndHTTPRoutesMustBeReady(t *testing.T, c client.Client, controllerName string, ...) string
- func GatewayStatusMustHaveListeners(t *testing.T, client client.Client, gwNN types.NamespacedName, ...)
- func HTTPRouteMustHaveNoAcceptedParents(t *testing.T, client client.Client, routeName types.NamespacedName, ...)
- func HTTPRouteMustHaveParents(t *testing.T, client client.Client, routeName types.NamespacedName, ...)
- func MustCreateSelfSignedCertSecret(t *testing.T, namespace, secretName string, hosts []string) *corev1.Secret
- func NamespacesMustBeReady(t *testing.T, c client.Client, namespaces []string, seconds int)
- func WaitForGatewayAddress(t *testing.T, client client.Client, gwName types.NamespacedName, seconds int) (string, error)
- type Applier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GWCMustBeAccepted ¶
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 ¶
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.
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 (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.